Re: 8051 assembler in Common Lisp
- From: Tim Wilson <no.email@xxxxxxxxxx>
- Date: Thu, 28 Jul 2005 04:33:32 GMT
On Wed, 27 Jul 2005 19:33:00 -0700, pkhuong wrote:
> Tim Wilson wrote :
>> I also don't know if I could have gone the EVAL approach and still used
>> the s-expr x86 address notation I used (ModR/M, etc. is a hairy
>> monster). Or the backpatching to fix forward labels.
>
> The addresses & variable length jumps problem looks to me like a
> constraint solving problem that wouldn't be that hard to express. I'd
> take a look at screamer (or screamer+, which has basic support for
> working on aggregate objects like objects or lists). I think it would
> still work with address arithmetic, too. Of course, this is a pretty
> big hammer for your problem, but it's already written, so why reinvent
> a (simpler) wheel?
I definitely would have, and I did know of the AMB operator. Hindsight is
20/20 and all that, though. Knowing what would work good and knowing how
to make it work as such are two different beasts, I'm afraid ;-)
It's simple enough that one day I may go back and change it. Right now
it's a 1.x pass assembler (where "x" is how many
lines/instructions contain an undefined label). Each line that references
an undefined label is tossed into a queue which is then replayed by the
same assembler engine. On the first pass each line is partially evaluated
and a guess is made to the final instruction size, so it does have its
problems (i.e. you must declare a byte label for small forward jumps, else
you get the default word size jump, which would be 16 or 32-bit). Other
assemblers generate optimal (smallest) code by adding more passes until
no instructions change. I find this on the ugly size, though, and would
definitely try a constraint system prior to doing that.
Tim
.
- References:
- 8051 assembler in Common Lisp
- From: Greg Menke
- Re: 8051 assembler in Common Lisp
- From: Tim Wilson
- Re: 8051 assembler in Common Lisp
- From: pkhuong
- 8051 assembler in Common Lisp
- Prev by Date: Re: can anyone offer Lisp job?
- Next by Date: Re: [OT] can anyone offer Lisp job?
- Previous by thread: Re: 8051 assembler in Common Lisp
- Next by thread: Re: 8051 assembler in Common Lisp
- Index(es):