This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Pass addresses of array, size, and sum through a table in memory. Show the calling program. Let VECTOR be the array, VSIZE hold the size, and VSUM hold the sum. All these variables are word variables. Let TABLE hold the address of VECTOR, TABLE+2 hold the address of VSIZE, and TABLE+4 hold the address of VSUM. ADDARRAY PROC FAR PUSH AX PUSH BX PUSH CX PUSH DI MOV BX, TABLE MOV DI, TABLE+2 MOV CX, [DI] MOV DI, TABLE+4 MOV AX, 0 NEXT: ADD AX, [BX] ADD BX, 2 LOOP NEXT MOV [DI], AX POP DI POP CX POP BX POP AX RET ADDARRAY ENDP Calling program LEA BX, VECTOR MOV TABLE, BX LEA BX, VSIZE MOV TABLE+2, BX LEA BX, VSUM MOV TABLE+4, BX CALL ADDARRAY...
View Full Document
- Fall '08
- Assembly Language, The Calling, 2000s music groups, Array data structure, bx, LEA DI