This preview shows pages 1–2. Sign up to view the full content.
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
This note was uploaded on 01/25/2012 for the course EE 3750 taught by Professor Desouza during the Fall '08 term at LSU.
- Fall '08