Advertisement
madmaxhasan

Reverse String

Apr 7th, 2018
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL
  2. .STACK 100
  3.  
  4. .DATA
  5.    
  6.     M1 DB "ENTER STRING: $"
  7.     M2 DB 10,13, "REVERSE STRING: $"
  8.     ARR DB '?'
  9.    
  10. .CODE
  11.  
  12. JOY PROC
  13.    
  14.     MOV AX, @DATA
  15.     MOV DS, AX
  16.    
  17.     LEA DX, M1
  18.     MOV AH, 9
  19.     INT 21H
  20.    
  21.     MOV SI, 0
  22.    
  23.     MOV AH, 1
  24.    
  25. TOP:
  26.     MOV ARR[SI], AL
  27.     INT 21H
  28.    
  29.     CMP AL, 0DH
  30.     JE PRINT
  31.    
  32.     INC SI
  33.     JMP TOP
  34.    
  35. PRINT:
  36.     LEA DX, M2
  37.     MOV AH, 9
  38.     INT 21H
  39.  
  40. TOOP:
  41.     MOV DL, ARR[SI]
  42.     MOV AH, 2
  43.     INT 21H
  44.     DEC SI
  45.     CMP SI, 0
  46.     JE EXIT
  47.     JMP TOOP
  48.    
  49. EXIT:
  50.     MOV AH, 4CH
  51.     INT 21H
  52.    
  53. JOY ENDP
  54. END JOY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement