Segment address plus offset address assignment

assume cs:code
code segment
	mov ax, 2000H
	mov ds, ax
	mov bx, 0
	mov ax, 1
	mov [bx], ax	;把2000:0000处的值赋值为1
	mov al, [bx]	;把2000:0000处的值赋值给al
	mov bx, 1		;bx=1
	mov ax, 2
	mov [bx], ax	;把2000:0001处的值赋值为2
	mov bl, [bx]	;把2000:0001处的值赋值给bl
	mov ax, 3	
	mov bx, 2		;
	mov [bx], ax	;把2000:0002处的值赋值为3
	mov cl, [bx]	;把2000:0002处的值赋值给cl
	mov ax, 4

	mov bx, 3
	mov [bx], ax	;把2000:0003处的值赋值为4
	mov dl, [bx]	;把2000:0003处的值赋值给dl
	
	mov ax, 4c00H
	int 21H
code ends
end

another:

assume cs:code
code segment
	mov ax, 2000H
	mov ds, ax
	mov al, ds:[0]
	mov bl, ds:[1]
	mov cl, ds:[2]
	mov dl, ds:[3]
	
	mov ax, 4C00H
	int 21H
code ends
end
78 original articles published · Like 3 · Visits 5596

Guess you like

Origin blog.csdn.net/qq_43071318/article/details/105264162