简体   繁体   中英

Invalid 8086 assembly statement

I have seen a sentence in assembly language and I don't know why it is wrong. Here it is:

mov cx, ch

.Why is this wrong?

您的指令是错误的,因为CX是16位而CH是8位(这是CX中的高8位

Your single line mov cx,ch can be wrong in 2 ways.
If the instruction is indeed MOV then the operands are wrong because they need to have the same size. This is what Dirk Wolfgang Glomp said.
But if the operands are correct then the instruction itself is wrong and should be replaced with MOVZX or MOVSX.

ps How strict should we interpret the tag 8086 ? ( x86 assembly is not limited to 16 bit)

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