用MASM6.11编译混合16bit和32bit有问题,请指教。

神杀中龙 2006-08-16 10:49:51
http://www.hackhome.com/2005/1-14/18234569320.shtml

就是这段关于进出保护模式的例子。
...全文
166 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
zara 2006-08-17
  • 打赏
  • 举报
回复
应该把 .model small,stdcall 语句放在 .386 之前. 这两个语句的顺序关系觉得了缺省的段大小模式. .386 在前为 32 位; .model 语句在前则为 16 位.

If the .MODEL directive is preceded by the .386 or .486 directive (or their privileged counterparts), the assembler uses 32-bit segments. If the .386 or .486 directive follows the .MODEL directive, the default 16-bit segments are used. The flat memory model uses 32-bit segments and must be preceded by a .386 or .486
directive.

32-bit segments are available only on the 80386/486 processors. They are not supported by any version of MS-DOS or by OS/2 before version 2.0.
神杀中龙 2006-08-17
  • 打赏
  • 举报
回复
恩,我去试验下。
神杀中龙 2006-08-16
  • 打赏
  • 举报
回复
是这个问题,我用 RadASM 编译不行,

我是想让 16bit 和 32bit的 寄存器能一起使用。
但是 一编译总 出现 标号错误,要不就是 您的CPU不支持此模式。
lielvbu 2006-08-16
  • 打赏
  • 举报
回复
什么问题?说出来先
神杀中龙 2006-08-16
  • 打赏
  • 举报
回复
我在 RadASM 里的 汇编器是 MASM 6.11

我创建的Console (控制台程序)
大侠看看我这段代码有问题吗,但总编译不过。
.386
.model small,stdcall
.stack
.data
.data?
.const
.code
start:
mov ax,4c00h
int 21h
end start
在MS DOS 7.x里 执行也是有问题的。

21,458

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧