Re: [Tuxnes-devel] help w/ tuxnes asm
Brought to you by:
tmmm
From: Mike M. <mel...@pc...> - 2001-04-10 04:02:59
|
On Mon, 9 Apr 2001, Rigel wrote: > All right. I know all about AT&T style syntax, I know many x86 opcodes, but I've never seen this type of addressing mode. This found on line 148 of table.x86 (in the BRK inst.), and looks like this: > "leal 0x0(%ebp,%ebx,2),%ebp". What's inside the parentheses? Okay, now I understand the question. That AT&T syntax is such a pain to digest sometimes. From plowing through my reference material, the above instruction means: ebp = ebp + (ebx * 2) + 0 I think that's it, but I'm not positive. > Got one more. there's a nice little couplet directly before the previous (lines 146,147) that looks like this: > testl $0xff,%edi > setz %bl > > This sets bl when? is it when edi == 0xff ? It looks to me like the net effect of the couplet is: if (!(edi & 0xff)) bl = 1; The test instruction performs a bitwise 'and' between the 2 operands. Like a cmp instruction, it discards the result but sets flags. The setz instruction stores a 1 into the destination if the zero flag is set. -- -Mike Melanson |