
PROGRAMMING CONCEPTS II 113
.CODE
.STARTUP
LEA BX, NUMS1 ;use BX to point to NUMS1
LEA SI, NUMS2 ;use SI to point to NUMS2
LEA DI, NUMS3 ;use DI to point to nUMS3
MOV CX, 06 ;CX = 6
REPEA: MOV AL, [BX] ;take into AL data from the array NUMS1
ADD AL, [SI] ;add to AL the data in array NUMS2
MOV [DI], AL ;save the sum in the third array
INC BX ;increment pointer
INC SI ;increment pointer
INC DI ;increment pointer
LOOP REPEA ;repeat the sequence until CX = 0
.EXIT
END
is problem can be done with less number of address registers if the ‘register relative mode’ of
addressing is used. See Example 3.10b. Here only the register ...