Re: [Tuxnes-devel] more help w/ asm
Brought to you by:
tmmm
|
From: Jim U. <ji...@3e...> - 2001-04-11 23:42:15
|
At 05:17pm on 2001 April 11, Rigel did write: > >Exactly. With lea you can do a mul, add, AND a shl (by > >2,4,or 8) > correction here. I think you mean a mult by 2, 4, or > 8 (which is really shl by 1, 2, 3). I only mention > this because I confuse the two all the time... What the...? That's what I get for re-editing my paragraph too many times. I meant, you can do a MOV, add, and a MUL (by 2, 4, or 8). > This whole gaffe of mine just illustrates another > reason I don't like x86 asm, which is that the > instructions are misnamed. LEA confused me for a long time, probably up until I looked it up in the Art of Assembly. > Okay, with the zero and sign flag (edi) you just give > it the latest result from the ALU, right? But what > about the carry flag (ebp) ? do I just set it to 1 > if there was a carry involved in the most recent > instruction? No, ebp is -1 on carry set, and 0 on carry clear. See SEC, CLC, and ROR - Immediate in table.x86 for examples. I am curious---what exactly are you doing? Are you trying to port the dynamic recompiler? I don't mean to discourage you, but surely it would be easier to use a C or asm interpreter, because the dynamic recompiler, although really cool, is also really hard to understand. For the SH-4 arch, I ripped out the recompiler and replaced it with a GPL'ed C core taken from nosefart, which was substantially easier, although with some speed cost. This could be reimplemented in assembly for some speedup (though it'd still be interpreted). You could always port the recompiler later. Jim -- "There is a very hollow echo of a gaur in the birth of that animal to a cow in Iowa. To say that is a gaur is to disrespect all gaurs in all the places where gaurs live. That animal will never live its life in true gaurdom, to wander in the forests of India and frolic with other gaurs and die and let teak trees grow out of it. That's the gaur I'm working to save." -K. Redford ji...@3e... / 0x43340710 / 517B C658 D2CB 260D 3E1F 5ED1 6DB3 FBB9 4334 0710 |