Click here to Skip to main content
15,886,018 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
So, did caeser cipher, but I have problem on string 68

What I have tried:

’’’
 IDEAL
MODEL small
STACK 100h
DATASEG
MSG1 DB 'ENTER FIVE CHARACTER : $'
MSG2 DB 10,13,'RESULT : $'
ARR1 DB 5 DUP (00)
ARR2 DB 5 DUP (00),'$'
CODESEG
start:

	MACRO AL
    CMP AL,'z'
    JA exit
    CMP AL,'A'
    JB exit
    CMP AL,'Z'
    JE decrease
    CMP AL,'z'
    JE decrease
    CMP AL,'Y'
    JE decrease
    CMP AL,'y'
    JE decrease
    CMP AL,'X'
    JE decrease
    CMP AL,'x'
    JE decrease
    
    add al,3
    JMP exit
    ;-----------------------
    decrease:
    SUB AL,23
    JMP exit
    ;-----------------------
    exit:
endm
;--------------------------------------------------
    
     MOV AX,@DATA
     MOV DS,AX 
     
     LEA SI,[ARR1]
     LEA DI,[ARR2]
     
     ;PRINT MSG1
     LEA DX,[MSG1]
     MOV AH,09
     INT 21H
     
     MOV CX,5   ;NUMBER OF CHARACTER IN WORD  
     
     INPUT:
     MOV AH,01
     INT 21H
     MOV [SI],AL
     INC SI
     LOOP INPUT
     
     ;--------------------------------------
     MOV DX,0000
     MOV CX,5
     LEA SI,[ARR1]
     
     OUTPUT:
     MOV AL,[SI]
     main AL
     MOV [DI],AL
     INC SI
     INC DI
     LOOP OUTPUT
     
     ;------------------------------------------               
     LEA DX,[MSG2]
     MOV AH,09
     INT 21H
     LEA DX,[ARR2]
     MOV AH,09
     INT 21H
exit:
	mov ax, 4c00h
	int 21h
END start
’’’
Posted
Updated 27-Oct-21 0:33am
Comments
Richard Deeming 27-Oct-21 6:15am    
If you can't even describe the problem clearly, then nobody can help you.

1 solution

Getting your code to assemble is not the end of the process: it is followed by testing and debugging (and normally this proceeds in a loop: code, test, debug, re-code, re-tect, debug again, ...).

So now you have reached the next stage - you have tested, and it doesn't work. SO ... on to debugging. I don't have or want a copy of TASM (it's been discontinued for 25 years now) but if you have a legit copy - and I have no idea how you managed that - it probably has Turbo Debugger with it so use that. (If not, probably your best bet is to move a a slightly less archaic toolset - I know that Visual Studio 2017 could assemble and debug 80786 code, but I have no idea about 2019 for example.)

Google will help you to use the selected debugger.

Follow your code in the debugger line by line, working out what you expected to happen before you execute each one, then compare that with what did happen. When you find a difference, you can start working out why.

Soprry, but we can't do that for you - time to learn a new skill - debugging!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900