简体   繁体   中英

Defining segments of assembly code with Tasm

So I was being taught the basics of how to program with Tasm (Turbo assembler 16 bits) and this two lines were explained to me, but now I can't remember why are they like this:

start: mov ax, data
       mov ds, ax

Why is it that we cannot use:

start: mov ds, data

I have looked for it on Google and in this site but I couldn't find an answer. Also, please correct my English in case of errors. Thank you.

The reason that you cannot do it is not a limitation in TASM but a "feature" of the instruction set. The Intel/AMD instruction sets do not support moving an immediate value into the DS register.

It is not unusual in CISC based computers to have various restrictions and limitations. It is very useful to keep the instruction reference handy for this reason. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM