注册 登录
编程论坛 汇编论坛

初学者问题

oujianqiang 发布于 2007-03-29 22:04, 632 次点击

下面代码有什么错误啊,用MASM5.0不能编译


prognam segment
;----------------------------------

main proc far
assume cs:prognam

start:
push ds
sub ax, ax
push ax
mov cx, 10

printit:
mov ah, 01
int 21h
mov dl, al
mov ah, 02
int 21h
dec cx
loop printit
ret

main endp
;-----------------------------------
prognam ends

;***********************************
end start

3 回复
#2
chaogang2007-03-31 13:32
不能编译 它跳出来的出错原因是什么啊?
#3
chaogang2007-03-31 13:34

好象RET是子程序返回到主程序的语句吧? 主程序的结束语句应该是HLT。
我也是上学期刚学的。半桶水,不知道对不对

#4
chaogang2007-04-01 16:53
汗... 来纠正一下自己的错误!
你这个程序可以正常运行的,那条语句不影响结果
1