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
orbp
, plus - optionally 1 of
si
ordi
, 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
Post a Comment