-
Notifications
You must be signed in to change notification settings - Fork 32
SassyNotes
Felix S. Klock II edited this page Jul 28, 2013
·
1 revision
This page is to take notes on the Sassy source base. It's not intended for Larceny specific stuff (though if Sassy is incompatible with Larceny for some reason, then it wouldn't be absurd to point it out here).
(Potential) Bugs:
- Why do the
export
directives affect the assembly output below? (That is, adding exports turns a10
and an8
to zeroes!)
> (sassy-text-list
(sassy '((export c_s_1) (export c_s_2)
(text (je c_s_2) (xor ebx ebx) (mov (& ecx 14) ebx) (jmp c_s_1)
(label c_s_2) (mov ebx 4) (mov (& ecx 14) ebx) (label c_s_1)))))
(15 132 0 0 0 0 49 219 137 89 14 233 0 0 0 0 187 4 0 0 0 137 89 14)
> (sassy-text-list
(sassy '((text (je c_s_2) (xor ebx ebx) (mov (& ecx 14) ebx) (jmp c_s_1)
(label c_s_2) (mov ebx 4) (mov (& ecx 14) ebx) (label c_s_1)))))
(15 132 10 0 0 0 49 219 137 89 14 233 8 0 0 0 187 4 0 0 0 137 89 14)
- (Jonathan Kraut says this is fixed in sassy--mainline--0.2.1--patch-10)
- GDB's disassembler and Sassy seem to be disagreeing on some input I'm feeding it (I think).
- The key instruction that I'm questioning is
(sub esp 152)
- Sassy is assembling this to the byte sequence
#x83 #xec #x98
- GDB seems to be disassembling it as
sub $0xffffff98,%ebp
- At runtime, when I step over the instruction in question,
$ebp
is0x861f80
before the step, and0x861fe8
after the step. - This means that we effectively subtracted -104 (in other words, we added 104). This isn't what we wanted at all.
- At runtime, when I step over the instruction in question,
- Perhaps Sassy is once again optimistically matching a numeric input as unsigned when the instruction in question is going to interpret the encoded number as signed. (Except I'm not sure that hypothesis makes sense given the numbers that are involved...)