Mov al, byte [memory] - adding padding?

Programming, for all ages and all languages.
Post Reply
User avatar
GraveMind
Posts: 12
Joined: Mon Feb 07, 2011 7:01 am
Location: London
Contact:

Mov al, byte [memory] - adding padding?

Post by GraveMind »

Hi,

Was trying to work out why this instruction causes padding in high memory. E.g "[memory location],00" after the instruction and ModRM byte.

Code I'm getting is:

Code: Select all

8A 16 C1 00 to represent mov dl, byte [memory]
Jim
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Mov al, byte [memory] - adding padding?

Post by Combuster »

There is no such thing as an 8 bit absolute address. You're running in 16 bits mode and therefore the absolute address is 16 bits wide (and occupies two bytes).
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
GraveMind
Posts: 12
Joined: Mon Feb 07, 2011 7:01 am
Location: London
Contact:

Re: Mov al, byte [memory] - adding padding?

Post by GraveMind »

Ah I see, thanks!
Post Reply