code segment
a db 1,2,3,4,5,6,7,8
b dw 0
.........
288页中写道:指令:inc b 相当于:inc word ptr cs:[8]这句话是错误的。int b是将b的地址加1,即b的偏移地址由8变为9;而inc word ptr cs:[8]是将cs:[8]这个单元内的内容加1。
大家可在debug中跟踪以下2个程序,看我说的是否正确。不管我是否说错,请大家积极回帖,说明自己的观点。这个很重要,关系到后续程序的编写。
##############################
assume cs:code
code segment
top dw 1,4,7,9
start: mov ax,0
mov ax,top
inc top
mov ax,top
inc top
mov ax,top
inc top
mov ax,top
mov ax,4c00h
int 21h
code ends
end start
#############################
#############################
assume cs:code
code segment
dw 1,4,7,9,12,15,19,22
start: mov ax,0
mov bx,0
mov cx,0
mov dx,0
inc word ptr cs:[0]
mov ax,cs:[0]
mov bx,cs:[2]
inc word ptr cs:[2]
mov cx,cs:[2]
mov dx,cs:[4]
mov ax,4c00h
int 21h
code ends
end start
############################ |