; Program to transfer Block Instruction
.MODEL SMALL
.STACK 100
.DATA
ARR1 DB 01H,02H,03H,04H,05H
ARR2 DB ?,?,?,?,?
.CODE
MOV AX , @DATA ; LOAD DATA SEGMENT
MOV DS , AX
MOV CX , 05H ; INITIALIZE COUNTER
MOV SI , OFFSET ARR1 ; INITIALIZE ARR1
MOV DI , OFFSET ARR2 ; INITIALIZE ARR2
UP:
MOV AL , [SI] ; LOAD ARR1 VALUE
MOV [DI] , AL ; STORE IN ARR2
INC SI ; INCREMENT SI ARR1 TO NEXT LOCATION
INC DI ; INCREMENT DI ARR2 TO NEXT LOCATION
LOOP UP ; DECREMENT BYTE COUNTER
; IF BYTE COUNTER == 0 THEN EXIT
; ELSE READ NEXT NUMBER
MOV AH , 4CH ; INTRUP TO EXIT
INT 21H
END
.MODEL SMALL
.STACK 100
.DATA
ARR1 DB 01H,02H,03H,04H,05H
ARR2 DB ?,?,?,?,?
.CODE
MOV AX , @DATA ; LOAD DATA SEGMENT
MOV DS , AX
MOV CX , 05H ; INITIALIZE COUNTER
MOV SI , OFFSET ARR1 ; INITIALIZE ARR1
MOV DI , OFFSET ARR2 ; INITIALIZE ARR2
UP:
MOV AL , [SI] ; LOAD ARR1 VALUE
MOV [DI] , AL ; STORE IN ARR2
INC SI ; INCREMENT SI ARR1 TO NEXT LOCATION
INC DI ; INCREMENT DI ARR2 TO NEXT LOCATION
LOOP UP ; DECREMENT BYTE COUNTER
; IF BYTE COUNTER == 0 THEN EXIT
; ELSE READ NEXT NUMBER
MOV AH , 4CH ; INTRUP TO EXIT
INT 21H
END