Slide 8.7: Memory addressing Slide 8.9: Memory addressing (cont.) Home |
mov al, [esi] |
inc [esi] |
inc BYTE PTR [esi] |
.data X BYTE 10 .code mov esi, OFFSET X mov al, [esi] add al, 1 mov X, al movzx eax, X call WriteInt |
.data X BYTE 10 .code mov esi, OFFSET X inc [esi] movzx eax, X call WriteInt |
.data X BYTE 10 .code mov esi, OFFSET X inc BYTE PTR [esi] movzx eax, X call WriteInt |
Output | Output | Output |
Adding up Array Elements | Adding up Elements of a Column |
.data array WORD 10, 20, 30, 40 .code mov esi, OFFSET array mov eax, 0 mov ecx, LENGTHOF array L1: add ax, [esi] add esi, 2 loop L1 call WriteInt |
.data tbl WORD 10, 20, 30, 40, 50, 60, 70, 80, 90 .code mov esi, OFFSET tbl mov eax, 0 mov ecx, 3 L1: add ax, [esi] add esi, 6 loop L1 call WriteInt |
Output | Output |