Advertisement
labib24

Untitled

Jul 21st, 2023
465
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL  
  2. .STACK 100H
  3.  
  4. .DATA
  5.     ARR DW 1,2,4,5,6,?     ;Declare a array
  6.        
  7. .CODE
  8.     MAIN PROC
  9.         MOV AX, @DATA
  10.         MOV DS,AX          ;Moves data in data segment
  11.         MOV ES, AX  
  12.        
  13.         STD                ;Set Direction flag
  14.         LEA SI, ARR+8
  15.         LEA DI, ARR+10  
  16.        
  17.         MOV CX,3
  18.         REP MOVSW           ;Moves word content
  19.        
  20.         MOV SI,4
  21.         MOV AX,3
  22.         STOSW              ;Moves contents of AL to byte address given by ES
  23.        
  24.         MOV CX, 6
  25.         XOR SI, SI          
  26.      
  27.                
  28.     LOP:  
  29.    
  30.         MOV DX,ARR[SI]
  31.         ADD DX,48
  32.         MOV AH,2
  33.         INT 21H
  34.                
  35.         ADD SI,2
  36.         LOOP LOP
  37.        
  38.         MAIN ENDP
  39.     END
  40.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement