returning multiple values from macro
Hello
I'm writing a small machine simulator in CL, using tagbody/go to
define the outer-most structure.
Each instruction looks something like this:
:state-instruction4
(some-debugging-code)
(... implementation of instruction using 'go' to make state
transitions ...)
My question is: How can I define a macro to replace that by something
like:
(state instruction4)
(... implementation of instruction ...)
where the 'state' defmacro should return two things: a symbol for the
target of the 'go', and a form of debugging code.
I wasn't able to find a way to return multiple values such that one of
them would be outside of forms. I thought perhaps of wrapping the
whole tagbody in a macro and walking and rewriting all the code
inside, but that seemed overly complex. (And made me feel like I was
missing something obvious when I started to try to write it!)
Thank you for any suggestions. Noob-ishly yours,
Scott
.
Relevant Pages
- Re: returning multiple values from macro
... I'm writing a small machine simulator in CL, using tagbody/go to ... Each instruction looks something like this: ... How can I define a macro to replace that by something ... lisp macros would be subject to code injection ... (comp.lang.lisp) - Re: The simplest Assembler
... modified/expanded version of my C preprocessor (it is basically a C ... E.g. the m4 macro processor. ... instruction forms, argument-list patterns, and registers). ... modified form of the Intel-docs notation as a specialized command-language. ... (comp.arch) - Re: How to read ADD,L as a symbol ?
... interface indentifiers in the operand arguments with lisp identifiers ... assembler identifiers. ... The PIC instruction set has a branch instruction that ... Suppose in the original assembly dialect, you have this macro: ... (comp.lang.lisp) - Re: The simplest Assembler
... split line into tokens; ... emit opcode and operands for the instruction form. ... The macro symbol table is initialized with the names of recognized ... (comp.arch) - Re: Need help with Assembler accessing VSAM file in reentrant LE-conforming program
... I could say in a manner comparable to that which led me to abandon xxxCB macros but over a much longer time since I wasn't tipped a wink that I was on the wrong track, I abandoned execute forms of macro completely. ... Just a raw SVC with an "equated" number and a reinforcing supporting comment such as "ISSUE OPEN SVC" seemed entirely adequate. ... Note that an intermediate stage was to prepare all the relevant data areas - in dynamically acquired storage of course - and registers in such a way that the execute form of the macro could be coded with the result that the macro had no option - in most cases - but simply to spit out the SVC instruction. ... the PSW is the updated after-program-check PSW. ... (bit.listserv.ibm-main) |
|