[Openmcl-devel] Creating a function from its disassembly

Gary King gwking at metabang.com
Fri Jun 10 19:49:13 UTC 2005


Yes, thanks.

On Jun 9, 2005, at 9:48 PM, Gary Byers wrote:

>
>
> On Thu, 9 Jun 2005, Gary King wrote:
>
>> Suppose I have the listing returned by disassemble (for example as a 
>> string). Is there some way for me to compile this assembly code into 
>> a callable function?
>>
>> Thanks,
>> -- 
>> Gary Warren King
>> metabang.com
>> http://www.metabang.com/
>>
>>
>
> I'm not sure that I understand the question, but you can do:
>
> ? (ccl::ppc-xdisassemble #'cdr :for-lap t)
> (NFUNCTION CDR
>   (LAMBDA (CCL::&LAP)
>     (CCL::PPC-LAP-FUNCTION CDR ()
>       (TWNEI NARGS 4)
>       (MFLR LOC-PC)
>       (BLA .SPSAVECONTEXTVSP)
>       (VPUSH ARG_Z)
>       (LWZ ARG_Z 0 VSP)
>       (CLRLWI IMM0 ARG_Z 30)
>       (TWNEI IMM0 1)
>       (LWZ ARG_Z -1 ARG_Z)
>       (BA .SPPOPJ))))
>
> That pretty-prints a form and returns (VALUES); it might be better if
> it returned the form.  If you mouse on that "NFUNCTION" form and
> execute it, it'll create a function (a "named function", in fact).
>
> Is that the sort of thing that you meant ?
>
>

-- 
Gary Warren King
metabang.com
http://www.metabang.com/




More information about the Openmcl-devel mailing list