Cannot access label through segment registers, error in assembly

大兔子大兔子 提交于 2019-12-01 22:49:58

I'm not sure what's in Irvine16.inc, but I bet it is saying .model small,... at some point.

If you add

ASSUME DS:_DATA

then your error messages will go away, although I doubt if that's enough to make the program run.


Ok, I've got an idea. I think you should switch to the 32-bit examples. That's a flat model where the segment registers are set up by the OS and not used by programs. I just downloaded the irvine examples and the sample project, which happens to be 32-bits did assemble and run.

In the wierd and twisted world that is x86 machine code, the 16-bit model is quite a bit more complex than the 32-bit model, at least from the point of view of a user program.

This error is caused by trying to assemble a DOS program (.model != flat) to a COFF .obj file. Additionally ML.EXE throws error A2006:undefined symbol : DGROUP. The source should be assembled to an old fashion OMF file. Build the file with following command lines:

ml.exe /omf hello.asm
link16.exe hello.obj, hello.exe;

ml.exe is part of the Visual Studio installation. link16.exe is part of Irvine's library suite (" Example programs and link library source code...").

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!