CS-401 Computer Architecture and Assembly Language Programming Lecture-6 Addressing Modes
Lets revise the last lecture
Memory Access Size
Memory Access Forms 16-bit Move mov ax, [num1]
Memory Access Forms 8-bit Move mov al, [num1]
Memory Access Forms Illegal Move mov ax, bl ; size mismatch mov [num1],[num2] ; mem to mem move
Memory Access Forms Ambiguous Move mov [num1], 5 ;5 is byte or ;word? Ambiguous mov byte[num1], 5 ;move 5 as byte mov word[num1], 5 ;move 5 as word
Loop Control L1: mov ax, bx add bx,2 sub cx,1 … L1: mov ax, bx add bx,2 sub cx,1 jnz L1 ; Jump to location L1 ; if the zero flag is ; not set
Loop Control mov cx, 10 ; load numbers count … mov bx, num1 ; point bx to first number mov cx, 10 ; load numbers count add ax, [bx] ; add number pointed by bx to ; ax l1: add bx, 2 sub cx, 1 jnz l1 mov [num1+20], ax ; write back result num1: dw 5…