4 ms·
#METOO from 1982: C:\>nokolisp 1> (comp-debug t)
by timonoko 6y ago
#METOO from 1982:
C:\>nokolisp
1> (comp-debug t)
t
2> (ncompile ’(plus a 1))
$O9CB:$7149: MOV AX, [$01BA]
$O9CB:$714C: CALL $0F1D ; CALL NUMVAL
$O9CB:$714F: MOV BX,$01
$O9CB:$7152: ADD AX,BX
$O9CB:$7154: CALL $05C0 ; CALL MAKNUM
$O9CB:$7157: JMP $1DA7
(subru: eval=$7149, compile=$3BB0)
- deleted 6y ago[deleted]
- sitkack 6y agoHow does the stack work? I assume $1DA7 is the outer interpreter loop? What is $3BB0 for?
- timonoko 6y agoThe stack is regular 16 bit CPU-stack. Unlike most or all others, i was using the CPU stack for Lisp-nodes. The garbage collector made many errors when marking data from CPU stack. But it does not matter, with 16 bits you can have 65000 nodes, enough for all eternity. JMP $1DA7 is basically return-from-closure. (subru: eval=$7149, compile=$3BB0) means that compiled functions are treated differently, when called from intrepreter and compiler. It was direct machine-code CALL in compiled code.