开发者

Assembler mov issue [duplicate]

开发者 https://www.devze.com 2023-01-15 23:13 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Assembler mov issue I have the next code:
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Assembler mov issue

I have the next code:

mov  ax,@开发者_StackOverflow社区data
mov  ds,ax

Why I can not write just like this?

mov ds,@data

All source:

   .MODEL small
   .STACK 100h
   .DATA
   HelloMessage DB 'Hello, world',13,10,'$'
   .CODE 
   .startup
   mov  ax,@data
   mov  ds,ax
   mov  ah,9
   mov  dx,OFFSET HelloMessage
   int  21h
   mov  ah,4ch
   int  21h
   END

Thank you!


You can't move directly @data in ds because you can't assign directly a segment to ds. You are allowed to move a register with the value of the segment you want to move in ds.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号