assembly - How do I get a register to store an offset value in at&t syntax? -


i using write video memory (%es = 0xb800):

movw $0x074b,%es:(0x0) 

however, if want offset in %ax?

i tried %es:%ax, or %es:(%ax), nothing worked, , kept getting errors.

what doing wrong?

in 16 bit mode limited in usable address forms. can't address using %ax. valid forms are:

  • optionally 1 of bx or bp, plus
  • optionally 1 of si or di, plus
  • optionally constant displacement

as such, movw $0x074b, %es:(%di) work, example. see table 2-1. 16-bit addressing forms modr/m byte in official intel® 64 , ia-32 architectures software developer's manual volume 2: instruction set reference, a-z

ps: next time show errors got.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -