datasegmentdb1h,20h,30h,40h,50h,60h,70h,70h,0,0dataendsstacksegmentdb0,0,0stackendscodesegmentassumecs:code,ds:data,ss:stackstart:movax,datamovds,axmovax,stackmovss,axmov...
data segment
db 1h,20h,30h,40h,50h,60h,70h,70h,0,0
data ends
stack segment
db 0,0,0
stack ends
code segment
assume cs:code ,ds:data ,ss:stack
start:
mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov sp,06
mov bx,[0]
mov cx,7
mov ah,0
mov bx,7
mov al,[bx]
mov bx,9
mov [bx],al
mov bx,0
mov al,[bx]
mov bx,8
mov [bx],al
mov dl,[bx]
call dispdec
mov ah,02
mov dl,0
int 21h
mov dh,0
mov dh,0
mov bx,9
mov dl,[bx]
call dispdec
mov ax,4c00h
int 21h
;显示十进制子程序
dispdec proc uses ax bx cx dx
mov ax,dx
xor dx,dx
mov bx,10
mov cx,0
a:
cmp ax,10
jb ok
div bx
add dl,30h
push dx
xor dx,dx
inc cx
jmp a
ok:
add al,30h
push ax
inc cx
b:
pop dx
mov ah,2
int 21h
loop b
ret
dispdec endp
code ends
end start
程序的目的的就是:将内存中第一个单元的数值放到第八个单元 第七个单元的内容放到第九个单元并按照十进制输出
但是我用masm编译后用cmd运行 和emu8086编译运行出的结果不一致 cmd运行的结果多了128 请问这是怎么回事? 并且我在用debug调试这个程序的时候 出现了 16bit ms-dos subsystem 错误 请问这是怎么回事? 谢谢
展开