[racket] assembly language

From: Hugh Aguilar (hughaguilar96 at yahoo.com)
Date: Tue Sep 25 19:38:26 EDT 2012

I don't want anything analogous to HLA, NASM, etc. I want an assembler that goes straight to memory.
 
I am writing a Forth system. I want it to be interactive in the usual Forth way. This means assembling a function at run-time and immediately being able to run the assembled function. 
 
What I was doing in HLA was writing a lot of functions in HLA assembly. Then, during the run-time of the HLA program, pasting together snippets of those functions to produce new functions. This involves poking values into the code snippets after they are pasted in, for such things as literal values and displacement values and so forth. This is a major hassle. It also has a lot of limitations to what can be done. I'm much better off if I can just assemble the functions at run-time for the Forth system (which is compile-time for the user's Forth program).
 
I would like 64-bit though. My understanding is that there are CL assemblers available that provide 64-bit, and there is Gambit Scheme's assembler that also provides 64-bit. I think Racket may get voted off the island. I'm still interested in Racket for other things though.
 

From: Tony Garnock-Jones <tonyg at ccs.neu.edu>
To: Hugh Aguilar <hughaguilar96 at yahoo.com> 
Cc: "users at racket-lang.org" <users at racket-lang.org> 
Sent: Tuesday, September 25, 2012 7:09 AM
Subject: Re: [racket] assembly language

On 09/24/2012 01:27 AM, Hugh Aguilar wrote:
> Is there an x86 assembler available in Racket? If so, does it support
> the 64-bit x86?

There's Noel Welsh's IA32 assembler https://github.com/noelwelsh/assembler. I guess it doesn't support x86_64 yet.

> I'm writing a program in HLA right now. HLA is limited to 32-bit x86 and
> I would prefer 64-bit, although I can stick with 32-bit if necessary.

I don't think there's anything directly analogous to HLA. Noel's work assembles straight to memory, rather than being an offline assembler. I suppose with a bit of work (ELF emitter) it could be used instead of gas.

Regards,
  Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120925/2feea4a2/attachment-0001.html>

Posted on the users mailing list.