From: manikanti sreedhar reddy

Subject: Getting Lisp code - similar to "disassemble"

Date: 2003-8-28 3:22

Hi,

Let us suppose say a function is defined as described below:

        cl-user(1): (defun sayHello()
        		(print "Hello"))
        SAYHELLO
        
        cl-user(2):(fdefinition 'sayHello)
        #<Interpreted Function SAYHELLO>
        
        cl-user(3):
        
        
Now, I am interested to get the actual function definition (lisp code),
which is similar to the functionality of "disassemble" (the disassemble
returns the assembly code, I am interested to retrieve the lisp code).

	cl-user(4): (disassemble 'sayHello)

                ;; disassembly of #<Function (:ANONYMOUS-LAMBDA 0) @
                #x715d1cd2>
                ;; formals: 
                ;; constant vector:
                0: "Hello"
                1: PRINT
                
                ;; code start: #x715d1c8c:
                   0: 55          pushl	ebp
                   1: 8b ec       movl	ebp,esp
                   3: 56          pushl	esi
                   4: 83 ec 24    subl	esp,$36
                   7: e3 02       jcxz	11
                   9: cd 61       int	$97             ;
                EXCL::TRAP-ARGERR
                  11: 80 7f 97 00 cmpb	[edi-105],$0    ;
                SYS::C_INTERRUPT
                  15: 74 02       jz	19
                  17: cd 64       int	$100            ;
                EXCL::TRAP-SIGNAL-HIT
                  19: 8b 46 12    movl	eax,[esi+18]    ; "Hello"
                  22: 8b 5e 16    movl	ebx,[esi+22]    ; PRINT
                  25: b1 01       movb	cl,$1
                  27: ff d7       call	*edi
                  29: c9          leave
                  30: 8b 75 fc    movl	esi,[ebp-4]
                  33: c3          ret
                
Is there any function or set of steps to get the lisp code?

Thanks,

-Sreedhar Reddy