include Macros.inc
if IsDefined( RealMode )
include irvine16.inc
else
include irvine32.inc
endif
.code
main PROC
startup
mWrite <"This program can be assembled to run ",0dh,0ah>
mWrite <"in both Real mode and Protected mode.",0dh,0ah>
call WaitMsg
exit
main ENDP
END main
当然也可以把mWrite宏所需要的参数写在一行如:
mWrite <"This program can be assembled to run in both Real mode and Protected mode.",0dh,0ah>
这样一来可以使得代码可读性更好,不过要注意的是,mWirte宏是以检测0dh,0ah来判断一个字符串的末尾的。所以如果在字符串当中给出这两个标志结束的编码就会导致错误。
本文介绍了一个能够在实模式和保护模式下运行的程序实例,通过条件编译选择不同的库文件,展示了如何使用mWrite宏进行字符串输出,同时强调了宏对0dh,0ah作为字符串结束标志的敏感性。
2300

被折叠的 条评论
为什么被折叠?



