|

楼主 |
发表于 2020-3-22 15:46:13
|
显示全部楼层
不过好像前两行没用来着。。。去掉前两行也通过编译了
- assume cs:codesg
- codesg segment
- mov ax,0020h
- mov es,ax
- mov cx,63
- s: mov bx,cx
- mov es:[bx],cl
- loop s
-
-
- mov ax,4c00H
- int 21h
- codesg ends
- end
复制代码
结果还是一样的
(2)
第二题让我用九行,结果我第一题就只用了8行.......就不重复贴代码了
(3)
先直接照着书上打,以得知程序存放的位置082e:0
而mov ax, 这个空格内容编译后会编译为0
-u 082e:0 之后得知mov ax,4c00h之前为0018h(24)个字节//虽然显示为0016h这一行,但事实上程序是从零开始的
我又想偷懒,直接 mov ax,ss来定位程序位置
- assume cs:codesg
- codesg segment
- mov ax,ss
- mov ds,ax
- mov ax,0020h
- mov es,ax
- mov bx,0
- mov cx,0016h
- s: mov al,[bx]
- mov es:[bx],al
- inc bx
- loop s
-
-
- mov ax,4c00H
- int 21h
- codesg ends
- end
复制代码
结果程序是在082e:0 ,而不是ss指向的082d:0
所以还是老老实实:
- assume cs:codesg
- codesg segment
- mov ax,082eh
- mov ds,ax
- mov ax,0018h
- mov es,ax
- mov bx,0
- mov cx,0016h
- s: mov al,[bx]
- mov es:[bx],al
- inc bx
- loop s
-
-
- mov ax,4c00H
- int 21h
- codesg ends
- end
复制代码
编译成功,结果也很完美 |
|