hanye332 发表于 2013-3-16 16:07:18

是关于王爽老师书中的第7章最后的一题的问题,请各位高手帮的解释一下 为什么!!

assume cs:codesg,ds:datasg,ss:stacksg
stacksg segment
dw 0,0,0,0,0,0,0,0
stacksg ends
datasg segment
db '1. display      '
db '2. brows      '
db '3. replace      '
db '4. modify       '
datasg ends
codesg segment
start:mov ax,datasg
      mov ds,ax
mov bx,0
mov ax,0
mov ax,stacksg
mov ss,ax
mov sp,16
mov cx,4
s0:push cx
      mov si,0
   mov cx,4
s: mov al,
and al,11011111b
mov ,al
inc si
loop s

add bx,16
pop cx
loop s0
mov ax,4c00h
int 21h
codesg ends
end start

上面是源代码,问题是这样的,在内循环中用AL总是报错! 但是我后来把他改成了AX就没有问题了,老是想不明白是为什么!! 请各位帮忙解释一下!!   谢谢大家

wawa 发表于 2013-3-16 21:44:54

mov ,al改成 mov byte ptr ,al

hanye332 发表于 2013-3-16 22:15:03

为什么要改成这样呢??不懂 也不理解能解释一下吗

小小小小鱼 发表于 2013-3-17 00:40:07

你吧SS段地址给AX AX没有清零的问题吧~!

hanye332 发表于 2013-3-17 11:58:13

不是这个问题!!

506076894 发表于 2013-3-18 16:47:21

hanye332 发表于 2013-3-16 22:15 static/image/common/back.gif
为什么要改成这样呢??不懂 也不理解能解释一下吗

因为al只能存放一个字节

hanye332 发表于 2013-3-20 03:24:47

你就补能多打几个字 解释的在详细些吗!!真是把我急死了快!

hanye332 发表于 2013-3-20 03:25:22

不过还是先谢谢你的解答!!:loveliness:
页: [1]
查看完整版本: 是关于王爽老师书中的第7章最后的一题的问题,请各位高手帮的解释一下 为什么!!