tinyjit icon indicating copy to clipboard operation
tinyjit copied to clipboard

How would I create and pass a buffer for the generated assembly to scribble on?

Open kozross opened this issue 6 years ago • 0 comments

Suppose I'm dynamically generating some assembly that will need a 4K buffer to do some scratch calculations in. It is not important what's left in it after it's done, but it has to be safe to scribble in for the generated assembly. I can pass an address in one of the registers to the generated assembly before calling it, but I'm not sure how to

  1. Allocate that buffer in Haskell-land; and
  2. Get its address as a pointer

What would you need to do for this? Is it ok just to allocate it as a Data.Vector Word of the appropriate length, or is something more involved?

kozross avatar Jul 09 '18 01:07 kozross