[MASM]Another 'cannot use 16-bit register with a 32-bit address' error

耗尽温柔 提交于 2019-12-04 10:46:51

I've done some researches and here is what I've learned

.MODEL directive

  • enables use of simplified segments
  • controls the name of the code segment
  • controls the default distance for procedures.

the syntax is :.MODEL memorymodel, options-optional

and memorymodel can be TINY, SMALL, COMPACT, MEDIUM, LARGE, HUGE,or FLAT

Flat model is similar to tiny model in that all code and data go in a single 32-bit -addressable block of memory.

To write a flat model program, specify the .386 or .486 directive before.

so the directive .386is optional if I don't want to use flat model (look here)

here are some references

1 .MODEL

2 Logical Segments and Memory Model Directives

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