Mail Archives: djgpp/1996/07/04/22:28:36
On 5/7/96 5:54 am, [vecna] <vecna AT Walden DOT mo DOT net> did thus say >>>
[snip]
> The immediate problem being, it can't recognize movzx. I can't think of any
movzbl movzbw movzwl for zero extend (byte to dword, byte to word, word to dword)
movsbl mobsbw movswl for sign extend (byte to dword, byte to word, word to dword)
> other alias this was be listed as... not to mention I'm really guessing here.
> There's probably tons of other flaws in this routine. (I really don't want to
> get into extended ASM just yet). Also, could someone confirm or correct me
> that a char is a byte, an int is 16 bits? (or is it 32?) geez, what I wouldn't
> give for db, dw, and dd right now.... oh well, thanks in advance.. :)
char = 8 bits
short = 16 bits
int = long = 32 bits
long long = 64 bits
You should always put the size suffix on your instructions or gas will try to
guess the correct size and it sometimes fails (eps with in/out). b for byte, w
for word, l for long (dword) eg movb %ah,%al, inw %dx,%ax.
Also, you cannot access local variabls (or parameters) without using extended
asm. It's not that dificult to use and if anyones interested, I can send some
examples (C++ class header, but the principles are language independent for C and
C++)
good luck and have fun
Bill
- Raw text -