diff --git a/bigint/build/bin/testbip b/bigint/build/bin/testbip index 9d6e4bb..e81fd53 100755 Binary files a/bigint/build/bin/testbip and b/bigint/build/bin/testbip differ diff --git a/bigint/build/lib/libbigint.a b/bigint/build/lib/libbigint.a index 9d557f4..8177943 100644 Binary files a/bigint/build/lib/libbigint.a and b/bigint/build/lib/libbigint.a differ diff --git a/bigint/src/bigint.o b/bigint/src/bigint.o index 4e68f95..95504f2 100644 Binary files a/bigint/src/bigint.o and b/bigint/src/bigint.o differ diff --git a/bigint/src/libbigint.a b/bigint/src/libbigint.a index 9d557f4..8177943 100644 Binary files a/bigint/src/libbigint.a and b/bigint/src/libbigint.a differ diff --git a/bigint/tst/support.o b/bigint/tst/support.o index f5bd62d..c619bb1 100644 Binary files a/bigint/tst/support.o and b/bigint/tst/support.o differ diff --git a/bigint/tst/testbip b/bigint/tst/testbip index 9d6e4bb..e81fd53 100755 Binary files a/bigint/tst/testbip and b/bigint/tst/testbip differ diff --git a/bigint/tst/testbip.o b/bigint/tst/testbip.o index 8acdffd..030f5b8 100644 Binary files a/bigint/tst/testbip.o and b/bigint/tst/testbip.o differ diff --git a/matinv.bin b/matinv.bin new file mode 100644 index 0000000..7414cba Binary files /dev/null and b/matinv.bin differ diff --git a/njlisp.asm b/njlisp.asm new file mode 100644 index 0000000..9142163 --- /dev/null +++ b/njlisp.asm @@ -0,0 +1,11070 @@ +// +// version +// + .vers 8 + +// +// execution framework +// +__start: + call _main + call _exit +__stop: + jmp __stop + +// +// Integer readInteger() +// +_readInteger: + asf 0 + rdint + popr + rsf + ret + +// +// void writeInteger(Integer) +// +_writeInteger: + asf 0 + pushl -3 + wrint + rsf + ret + +// +// Character readCharacter() +// +_readCharacter: + asf 0 + rdchr + popr + rsf + ret + +// +// void writeCharacter(Character) +// +_writeCharacter: + asf 0 + pushl -3 + wrchr + rsf + ret + +// +// Integer char2int(Character) +// +_char2int: + asf 0 + pushl -3 + popr + rsf + ret + +// +// Character int2char(Integer) +// +_int2char: + asf 0 + pushl -3 + popr + rsf + ret + +// +// void exit() +// +_exit: + asf 0 + halt + rsf + ret + +// +// void writeString(String) +// +_writeString: + asf 1 + pushc 0 + popl 0 + jmp _writeString_L2 +_writeString_L1: + pushl -3 + pushl 0 + getfa + call _writeCharacter + drop 1 + pushl 0 + pushc 1 + add + popl 0 +_writeString_L2: + pushl 0 + pushl -3 + getsz + lt + brt _writeString_L1 + rsf + ret + +// +// void debug(Integer) +// +_debug: + asf 0 + pushc 7 + newa + dup + pushc 0 + pushc 68 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 66 + putfa + dup + pushc 3 + pushc 85 + putfa + dup + pushc 4 + pushc 71 + putfa + dup + pushc 5 + pushc 58 + putfa + dup + pushc 6 + pushc 32 + putfa + call _writeString + drop 1 + pushl -3 + call _writeInteger + drop 1 + pushc 1 + newa + dup + pushc 0 + pushc 10 + putfa + call _writeString + drop 1 +__0: + rsf + ret + +// +// Boolean isAlpha(Character) +// +_isAlpha: + asf 0 + pushl -3 + pushc 65 + ge + dup + brf __3 + drop 1 + pushl -3 + pushc 90 + le +__3: + dup + brt __2 + drop 1 + pushl -3 + pushc 97 + ge + dup + brf __4 + drop 1 + pushl -3 + pushc 122 + le +__4: +__2: + popr + jmp __1 +__1: + rsf + ret + +// +// Boolean isDigit(Character) +// +_isDigit: + asf 0 + pushl -3 + pushc 48 + ge + dup + brf __6 + drop 1 + pushl -3 + pushc 57 + le +__6: + popr + jmp __5 +__5: + rsf + ret + +// +// Character toLower(Character) +// +_toLower: + asf 0 + pushl -3 + pushc 65 + ge + dup + brf __9 + drop 1 + pushl -3 + pushc 90 + le +__9: + brf __8 + pushl -3 + call _char2int + drop 1 + pushr + pushc 32 + add + call _int2char + drop 1 + pushr + popl -3 +__8: + pushl -3 + popr + jmp __7 +__7: + rsf + ret + +// +// Character toUpper(Character) +// +_toUpper: + asf 0 + pushl -3 + pushc 97 + ge + dup + brf __12 + drop 1 + pushl -3 + pushc 122 + le +__12: + brf __11 + pushl -3 + call _char2int + drop 1 + pushr + pushc 32 + sub + call _int2char + drop 1 + pushr + popl -3 +__11: + pushl -3 + popr + jmp __10 +__10: + rsf + ret + +// +// Character[] toString(Character) +// +_toString: + asf 1 + pushc 1 + newa + popl 0 + pushl 0 + pushc 0 + pushl -3 + putfa + pushl 0 + popr + jmp __13 +__13: + rsf + ret + +// +// Integer stringCompare(Character[], Character[]) +// +_stringCompare: + asf 3 + pushl -4 + getsz + popl 0 + pushl -3 + getsz + popl 1 + pushc 0 + popl 2 + jmp __16 +__15: + pushl -4 + pushl 2 + getfa + pushl -3 + pushl 2 + getfa + ne + brf __18 + pushl -4 + pushl 2 + getfa + call _char2int + drop 1 + pushr + pushl -3 + pushl 2 + getfa + call _char2int + drop 1 + pushr + sub + popr + jmp __14 +__18: + pushl 2 + pushc 1 + add + popl 2 +__16: + pushl 2 + pushl 0 + lt + dup + brf __19 + drop 1 + pushl 2 + pushl 1 + lt +__19: + brt __15 +__17: + pushl 0 + pushl 1 + sub + popr + jmp __14 +__14: + rsf + ret + +// +// record { String str; Integer len; } newStringBuffer(Integer) +// +_newStringBuffer: + asf 1 + new 2 + popl 0 + pushl 0 + pushl -3 + newa + putf 0 + pushl 0 + pushc 0 + putf 1 + pushl 0 + popr + jmp __20 +__20: + rsf + ret + +// +// void addCharToStringBuffer(record { String str; Integer len; }, Character) +// +_addCharToStringBuffer: + asf 2 + pushl -4 + getf 1 + pushc 1 + add + pushl -4 + getf 0 + getsz + gt + brf __22 + pushc 2 + pushl -4 + getf 0 + getsz + mul + newa + popl 0 + pushc 0 + popl 1 + jmp __24 +__23: + pushl 0 + pushl 1 + pushl -4 + getf 0 + pushl 1 + getfa + putfa + pushl 1 + pushc 1 + add + popl 1 +__24: + pushl 1 + pushl -4 + getf 1 + lt + brt __23 +__25: + pushl -4 + pushl 0 + putf 0 +__22: + pushl -4 + getf 0 + pushl -4 + getf 1 + pushl -3 + putfa + pushl -4 + pushl -4 + getf 1 + pushc 1 + add + putf 1 +__21: + rsf + ret + +// +// void addStringToStringBuffer(record { String str; Integer len; }, Character[]) +// +_addStringToStringBuffer: + asf 2 + pushl -3 + getsz + popl 0 + pushc 0 + popl 1 + jmp __28 +__27: + pushl -4 + pushl -3 + pushl 1 + getfa + call _addCharToStringBuffer + drop 2 + pushl 1 + pushc 1 + add + popl 1 +__28: + pushl 1 + pushl 0 + lt + brt __27 +__29: +__26: + rsf + ret + +// +// Character[] stringBufferToString(record { String str; Integer len; }) +// +_stringBufferToString: + asf 2 + pushl -3 + getf 1 + newa + popl 0 + pushc 0 + popl 1 + jmp __32 +__31: + pushl 0 + pushl 1 + pushl -3 + getf 0 + pushl 1 + getfa + putfa + pushl 1 + pushc 1 + add + popl 1 +__32: + pushl 1 + pushl -3 + getf 1 + lt + brt __31 +__33: + pushl 0 + popr + jmp __30 +__30: + rsf + ret + +// +// void error(Character[], Boolean) +// +_error: + asf 0 + pushc 1 + newa + dup + pushc 0 + pushc 10 + putfa + call _writeString + drop 1 + pushl -4 + call _writeString + drop 1 + pushc 2 + newa + dup + pushc 0 + pushc 10 + putfa + dup + pushc 1 + pushc 10 + putfa + call _writeString + drop 1 + pushl -3 + brf __35 + call _exit +__35: +__34: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeNil() +// +_makeNil: + asf 1 + new 6 + popl 0 + pushl 0 + pushg 0 + putf 0 + pushl 0 + pushl 0 + putf 1 + pushl 0 + pushl 0 + putf 2 + pushl 0 + pushl 0 + putf 3 + pushl 0 + pushc 3 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 76 + putfa + putf 4 + pushl 0 + popr + jmp __36 +__36: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeName(Character[]) +// +_makeName: + asf 1 + new 6 + popl 0 + pushl 0 + pushg 0 + putf 0 + pushl 0 + pushl 0 + putf 1 + pushl 0 + pushg 10 + putf 2 + pushl 0 + pushg 10 + putf 3 + pushl 0 + pushl -3 + putf 4 + pushl 0 + popr + jmp __37 +__37: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeNumber(Integer) +// +_makeNumber: + asf 1 + new 6 + popl 0 + pushl 0 + pushg 1 + putf 0 + pushl 0 + pushl 0 + putf 1 + pushl -3 + pushc 0 + lt + brf __39 + pushl 0 + pushg 11 + putf 2 + jmp __40 +__39: + pushl 0 + pushg 10 + putf 2 +__40: + pushl 0 + pushl -3 + putf 5 + pushl 0 + popr + jmp __38 +__38: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeNode(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_makeNode: + asf 1 + new 6 + popl 0 + pushl 0 + pushg 2 + putf 0 + pushl 0 + pushl -4 + putf 1 + pushl 0 + pushl -3 + putf 2 + pushl 0 + popr + jmp __41 +__41: + rsf + ret + +// +// void addOblist(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_addOblist: + asf 0 + pushl -3 + pushg 8 + call _makeNode + drop 2 + pushr + popg 8 +__42: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeObject(Character[]) +// +_makeObject: + asf 1 + pushl -3 + call _makeName + drop 1 + pushr + popl 0 + pushl 0 + call _addOblist + drop 1 + pushl 0 + popr + jmp __43 +__43: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } makeBuiltin(Character[], record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, Integer) +// +_makeBuiltin: + asf 1 + pushl -5 + call _makeObject + drop 1 + pushr + popl 0 + pushl 0 + pushl -4 + pushl -3 + call _makeNumber + drop 1 + pushr + call _makeNode + drop 2 + pushr + putf 3 + pushl 0 + popr + jmp __44 +__44: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } searchOblist(Character[]) +// +_searchOblist: + asf 1 + pushg 8 + popl 0 + jmp __47 +__46: + pushl 0 + getf 1 + getf 4 + pushl -3 + call _stringCompare + drop 2 + pushr + pushc 0 + eq + brf __49 + pushl 0 + getf 1 + popr + jmp __45 +__49: + pushl 0 + getf 2 + popl 0 +__47: + pushl 0 + getf 0 + pushg 2 + eq + brt __46 +__48: + pushl -3 + call _makeObject + drop 1 + pushr + popr + jmp __45 +__45: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } copyTree(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_copyTree: + asf 2 + pushg 10 + pushg 10 + call _makeNode + drop 2 + pushr + popl 0 + pushl 0 + pushl 0 + putf 1 + jmp __52 +__51: + pushl -3 + getf 1 + call _copyTree + drop 1 + pushr + popl 1 + pushl 0 + getf 1 + pushl 1 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 0 + pushl 0 + getf 1 + getf 2 + putf 1 + pushl -3 + getf 2 + popl -3 +__52: + pushl -3 + getf 0 + pushg 2 + eq + brt __51 +__53: + pushl 0 + getf 1 + pushl -3 + putf 2 + pushl 0 + getf 2 + popr + jmp __50 +__50: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } execErr(Integer) +// +_execErr: + asf 0 + pushc 15 + newa + dup + pushc 0 + pushc 101 + putfa + dup + pushc 1 + pushc 120 + putfa + dup + pushc 2 + pushc 101 + putfa + dup + pushc 3 + pushc 99 + putfa + dup + pushc 4 + pushc 58 + putfa + dup + pushc 5 + pushc 32 + putfa + dup + pushc 6 + pushc 102 + putfa + dup + pushc 7 + pushc 117 + putfa + dup + pushc 8 + pushc 110 + putfa + dup + pushc 9 + pushc 99 + putfa + dup + pushc 10 + pushc 116 + putfa + dup + pushc 11 + pushc 105 + putfa + dup + pushc 12 + pushc 111 + putfa + dup + pushc 13 + pushc 110 + putfa + dup + pushc 14 + pushc 32 + putfa + call _writeString + drop 1 + pushl -3 + call _writeInteger + drop 1 + pushc 17 + newa + dup + pushc 0 + pushc 32 + putfa + dup + pushc 1 + pushc 110 + putfa + dup + pushc 2 + pushc 111 + putfa + dup + pushc 3 + pushc 116 + putfa + dup + pushc 4 + pushc 32 + putfa + dup + pushc 5 + pushc 105 + putfa + dup + pushc 6 + pushc 109 + putfa + dup + pushc 7 + pushc 112 + putfa + dup + pushc 8 + pushc 108 + putfa + dup + pushc 9 + pushc 101 + putfa + dup + pushc 10 + pushc 109 + putfa + dup + pushc 11 + pushc 101 + putfa + dup + pushc 12 + pushc 110 + putfa + dup + pushc 13 + pushc 116 + putfa + dup + pushc 14 + pushc 101 + putfa + dup + pushc 15 + pushc 100 + putfa + dup + pushc 16 + pushc 10 + putfa + call _writeString + drop 1 + call _exit + pushg 10 + popr + jmp __54 +__54: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } exec(Integer, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_exec: + asf 0 + pushl -6 + pushc 0 + lt + dup + brt __57 + drop 1 + pushl -6 + pushc 128 + ge +__57: + brf __56 + pushc 19 + newa + dup + pushc 0 + pushc 73 + putfa + dup + pushc 1 + pushc 110 + putfa + dup + pushc 2 + pushc 116 + putfa + dup + pushc 3 + pushc 101 + putfa + dup + pushc 4 + pushc 114 + putfa + dup + pushc 5 + pushc 110 + putfa + dup + pushc 6 + pushc 97 + putfa + dup + pushc 7 + pushc 108 + putfa + dup + pushc 8 + pushc 32 + putfa + dup + pushc 9 + pushc 69 + putfa + dup + pushc 10 + pushc 120 + putfa + dup + pushc 11 + pushc 101 + putfa + dup + pushc 12 + pushc 99 + putfa + dup + pushc 13 + pushc 32 + putfa + dup + pushc 14 + pushc 69 + putfa + dup + pushc 15 + pushc 114 + putfa + dup + pushc 16 + pushc 114 + putfa + dup + pushc 17 + pushc 111 + putfa + dup + pushc 18 + pushc 114 + putfa + pushc 0 + call _error + drop 2 + pushg 10 + popr + jmp __55 +__56: + pushl -6 + pushc 64 + lt + brf __58 + pushl -6 + pushc 32 + lt + brf __60 + pushl -6 + pushc 16 + lt + brf __62 + pushl -6 + pushc 8 + lt + brf __64 + pushl -6 + pushc 4 + lt + brf __66 + pushl -6 + pushc 2 + lt + brf __68 + pushl -6 + pushc 1 + lt + brf __70 + pushl -5 + call _car + drop 1 + pushr + popr + jmp __55 + jmp __71 +__70: + pushl -5 + call _cdr + drop 1 + pushr + popr + jmp __55 +__71: + jmp __69 +__68: + pushl -6 + pushc 3 + lt + brf __72 + pushl -5 + call _caar + drop 1 + pushr + popr + jmp __55 + jmp __73 +__72: + pushl -5 + call _cadr + drop 1 + pushr + popr + jmp __55 +__73: +__69: + jmp __67 +__66: + pushl -6 + pushc 6 + lt + brf __74 + pushl -6 + pushc 5 + lt + brf __76 + pushl -5 + call _cdar + drop 1 + pushr + popr + jmp __55 + jmp __77 +__76: + pushl -5 + call _cddr + drop 1 + pushr + popr + jmp __55 +__77: + jmp __75 +__74: + pushl -6 + pushc 7 + lt + brf __78 + pushl -5 + call _caaar + drop 1 + pushr + popr + jmp __55 + jmp __79 +__78: + pushl -5 + call _caadr + drop 1 + pushr + popr + jmp __55 +__79: +__75: +__67: + jmp __65 +__64: + pushl -6 + pushc 12 + lt + brf __80 + pushl -6 + pushc 10 + lt + brf __82 + pushl -6 + pushc 9 + lt + brf __84 + pushl -5 + call _cadar + drop 1 + pushr + popr + jmp __55 + jmp __85 +__84: + pushl -5 + call _caddr + drop 1 + pushr + popr + jmp __55 +__85: + jmp __83 +__82: + pushl -6 + pushc 11 + lt + brf __86 + pushl -5 + call _cdaar + drop 1 + pushr + popr + jmp __55 + jmp __87 +__86: + pushl -5 + call _cdadr + drop 1 + pushr + popr + jmp __55 +__87: +__83: + jmp __81 +__80: + pushl -6 + pushc 14 + lt + brf __88 + pushl -6 + pushc 13 + lt + brf __90 + pushl -5 + call _cddar + drop 1 + pushr + popr + jmp __55 + jmp __91 +__90: + pushl -5 + call _cdddr + drop 1 + pushr + popr + jmp __55 +__91: + jmp __89 +__88: + pushl -6 + pushc 15 + lt + brf __92 + pushl -5 + pushl -4 + call _cons + drop 2 + pushr + popr + jmp __55 + jmp __93 +__92: + pushl -5 + call _list + drop 1 + pushr + popr + jmp __55 +__93: +__89: +__81: +__65: + jmp __63 +__62: + pushl -6 + pushc 24 + lt + brf __94 + pushl -6 + pushc 20 + lt + brf __96 + pushl -6 + pushc 18 + lt + brf __98 + pushl -6 + pushc 17 + lt + brf __100 + pushl -5 + pushl -4 + call _reverse + drop 2 + pushr + popr + jmp __55 + jmp __101 +__100: + call _oblist + pushr + popr + jmp __55 +__101: + jmp __99 +__98: + pushl -6 + pushc 19 + lt + brf __102 + pushl -5 + pushl -4 + call _rplaca + drop 2 + pushr + popr + jmp __55 + jmp __103 +__102: + pushl -5 + pushl -4 + call _rplacd + drop 2 + pushr + popr + jmp __55 +__103: +__99: + jmp __97 +__96: + pushl -6 + pushc 22 + lt + brf __104 + pushl -6 + pushc 21 + lt + brf __106 + pushl -5 + pushl -4 + call _nconc + drop 2 + pushr + popr + jmp __55 + jmp __107 +__106: + pushl -5 + call _name + drop 1 + pushr + popr + jmp __55 +__107: + jmp __105 +__104: + pushl -6 + pushc 23 + lt + brf __108 + pushl -5 + call _numberp + drop 1 + pushr + popr + jmp __55 + jmp __109 +__108: + pushl -5 + call _atom + drop 1 + pushr + popr + jmp __55 +__109: +__105: +__97: + jmp __95 +__94: + pushl -6 + pushc 28 + lt + brf __110 + pushl -6 + pushc 26 + lt + brf __112 + pushl -6 + pushc 25 + lt + brf __114 + pushl -5 + call _null + drop 1 + pushr + popr + jmp __55 + jmp __115 +__114: + pushl -5 + call _plusp + drop 1 + pushr + popr + jmp __55 +__115: + jmp __113 +__112: + pushl -6 + pushc 27 + lt + brf __116 + pushl -5 + call _minusp + drop 1 + pushr + popr + jmp __55 + jmp __117 +__116: + pushl -5 + call _zerop + drop 1 + pushr + popr + jmp __55 +__117: +__113: + jmp __111 +__110: + pushl -6 + pushc 30 + lt + brf __118 + pushl -6 + pushc 29 + lt + brf __120 + pushl -5 + call _even + drop 1 + pushr + popr + jmp __55 + jmp __121 +__120: + pushl -5 + pushl -4 + call _eq + drop 2 + pushr + popr + jmp __55 +__121: + jmp __119 +__118: + pushl -6 + pushc 31 + lt + brf __122 + pushl -5 + pushl -4 + call _equal + drop 2 + pushr + popr + jmp __55 + jmp __123 +__122: + pushl -5 + pushl -4 + call _member + drop 2 + pushr + popr + jmp __55 +__123: +__119: +__111: +__95: +__63: + jmp __61 +__60: + pushl -6 + pushc 48 + lt + brf __124 + pushl -6 + pushc 40 + lt + brf __126 + pushl -6 + pushc 36 + lt + brf __128 + pushl -6 + pushc 34 + lt + brf __130 + pushl -6 + pushc 33 + lt + brf __132 + pushl -5 + pushl -4 + call _greaterp + drop 2 + pushr + popr + jmp __55 + jmp __133 +__132: + pushl -5 + pushl -4 + call _lessp + drop 2 + pushr + popr + jmp __55 +__133: + jmp __131 +__130: + pushl -6 + pushc 35 + lt + brf __134 + pushl -5 + pushl -4 + call _orderp + drop 2 + pushr + popr + jmp __55 + jmp __135 +__134: + pushl -5 + call _not + drop 1 + pushr + popr + jmp __55 +__135: +__131: + jmp __129 +__128: + pushl -6 + pushc 38 + lt + brf __136 + pushl -6 + pushc 37 + lt + brf __138 + pushl -5 + call _and + drop 1 + pushr + popr + jmp __55 + jmp __139 +__138: + pushl -5 + call _or + drop 1 + pushr + popr + jmp __55 +__139: + jmp __137 +__136: + pushl -6 + pushc 39 + lt + brf __140 + pushl -5 + pushl -4 + call _set + drop 2 + pushr + popr + jmp __55 + jmp __141 +__140: + pushl -5 + call _setq + drop 1 + pushr + popr + jmp __55 +__141: +__137: +__129: + jmp __127 +__126: + pushl -6 + pushc 44 + lt + brf __142 + pushl -6 + pushc 42 + lt + brf __144 + pushl -6 + pushc 41 + lt + brf __146 + pushl -5 + call _pop + drop 1 + pushr + popr + jmp __55 + jmp __147 +__146: + pushl -5 + call _push + drop 1 + pushr + popr + jmp __55 +__147: + jmp __145 +__144: + pushl -6 + pushc 43 + lt + brf __148 + pushl -5 + pushl -4 + call _assoc + drop 2 + pushr + popr + jmp __55 + jmp __149 +__148: + pushl -5 + pushl -4 + call _get + drop 2 + pushr + popr + jmp __55 +__149: +__145: + jmp __143 +__142: + pushl -6 + pushc 46 + lt + brf __150 + pushl -6 + pushc 45 + lt + brf __152 + pushl -5 + pushl -4 + pushl -3 + call _put + drop 3 + pushr + popr + jmp __55 + jmp __153 +__152: + pushl -5 + pushl -4 + call _remprop + drop 2 + pushr + popr + jmp __55 +__153: + jmp __151 +__150: + pushl -6 + pushc 47 + lt + brf __154 + pushl -5 + pushl -4 + call _flagp + drop 2 + pushr + popr + jmp __55 + jmp __155 +__154: + pushl -5 + pushl -4 + call _flag + drop 2 + pushr + popr + jmp __55 +__155: +__151: +__143: +__127: + jmp __125 +__124: + pushl -6 + pushc 56 + lt + brf __156 + pushl -6 + pushc 52 + lt + brf __158 + pushl -6 + pushc 50 + lt + brf __160 + pushl -6 + pushc 49 + lt + brf __162 + pushl -5 + pushl -4 + call _remflag + drop 2 + pushr + popr + jmp __55 + jmp __163 +__162: + pushl -5 + call _getd + drop 1 + pushr + popr + jmp __55 +__163: + jmp __161 +__160: + pushl -6 + pushc 51 + lt + brf __164 + pushl -5 + pushl -4 + call _putd + drop 2 + pushr + popr + jmp __55 + jmp __165 +__164: + pushl -5 + pushl -4 + call _movd + drop 2 + pushr + popr + jmp __55 +__165: +__161: + jmp __159 +__158: + pushl -6 + pushc 54 + lt + brf __166 + pushl -6 + pushc 53 + lt + brf __168 + pushl -5 + call _pack + drop 1 + pushr + popr + jmp __55 + jmp __169 +__168: + pushl -5 + call _unpack + drop 1 + pushr + popr + jmp __55 +__169: + jmp __167 +__166: + pushl -6 + pushc 55 + lt + brf __170 + pushl -5 + call _length + drop 1 + pushr + popr + jmp __55 + jmp __171 +__170: + pushl -5 + call _minus + drop 1 + pushr + popr + jmp __55 +__171: +__167: +__159: + jmp __157 +__156: + pushl -6 + pushc 60 + lt + brf __172 + pushl -6 + pushc 58 + lt + brf __174 + pushl -6 + pushc 57 + lt + brf __176 + pushl -5 + pushl -4 + call _plus + drop 2 + pushr + popr + jmp __55 + jmp __177 +__176: + pushl -5 + pushl -4 + call _difference + drop 2 + pushr + popr + jmp __55 +__177: + jmp __175 +__174: + pushl -6 + pushc 59 + lt + brf __178 + pushl -5 + pushl -4 + call _times + drop 2 + pushr + popr + jmp __55 + jmp __179 +__178: + pushl -5 + pushl -4 + call _quotient + drop 2 + pushr + popr + jmp __55 +__179: +__175: + jmp __173 +__172: + pushl -6 + pushc 62 + lt + brf __180 + pushl -6 + pushc 61 + lt + brf __182 + pushl -5 + pushl -4 + call _remainder + drop 2 + pushr + popr + jmp __55 + jmp __183 +__182: + pushl -5 + pushl -4 + call _divide + drop 2 + pushr + popr + jmp __55 +__183: + jmp __181 +__180: + pushl -6 + pushc 63 + lt + brf __184 + pushl -5 + pushl -4 + pushl -3 + call _rds + drop 3 + pushr + popr + jmp __55 + jmp __185 +__184: + call _ratom + pushr + popr + jmp __55 +__185: +__181: +__173: +__157: +__125: +__61: + jmp __59 +__58: + pushl -6 + pushc 96 + lt + brf __186 + pushl -6 + pushc 80 + lt + brf __188 + pushl -6 + pushc 72 + lt + brf __190 + pushl -6 + pushc 68 + lt + brf __192 + pushl -6 + pushc 66 + lt + brf __194 + pushl -6 + pushc 65 + lt + brf __196 + call _read + pushr + popr + jmp __55 + jmp __197 +__196: + call _readch + pushr + popr + jmp __55 +__197: + jmp __195 +__194: + pushl -6 + pushc 67 + lt + brf __198 + pushl -5 + pushl -4 + pushl -3 + call _wrs + drop 3 + pushr + popr + jmp __55 + jmp __199 +__198: + pushl -5 + call _print + drop 1 + pushr + popr + jmp __55 +__199: +__195: + jmp __193 +__192: + pushl -6 + pushc 70 + lt + brf __200 + pushl -6 + pushc 69 + lt + brf __202 + pushl -5 + call _prin1 + drop 1 + pushr + popr + jmp __55 + jmp __203 +__202: + pushl -5 + call _terpri + drop 1 + pushr + popr + jmp __55 +__203: + jmp __201 +__200: + pushl -6 + pushc 71 + lt + brf __204 + pushl -5 + call _spaces + drop 1 + pushr + popr + jmp __55 + jmp __205 +__204: + pushl -5 + call _linelength + drop 1 + pushr + popr + jmp __55 +__205: +__201: +__193: + jmp __191 +__190: + pushl -6 + pushc 76 + lt + brf __206 + pushl -6 + pushc 74 + lt + brf __208 + pushl -6 + pushc 73 + lt + brf __210 + pushl -5 + call _radix + drop 1 + pushr + popr + jmp __55 + jmp __211 +__210: + pushl -5 + call _quote + drop 1 + pushr + popr + jmp __55 +__211: + jmp __209 +__208: + pushl -6 + pushc 75 + lt + brf __212 + pushl -5 + call _eval + drop 1 + pushr + popr + jmp __55 + jmp __213 +__212: + pushl -5 + pushl -4 + call _apply + drop 2 + pushr + popr + jmp __55 +__213: +__209: + jmp __207 +__206: + pushl -6 + pushc 78 + lt + brf __214 + pushl -6 + pushc 77 + lt + brf __216 + pushl -5 + call _cond + drop 1 + pushr + popr + jmp __55 + jmp __217 +__216: + pushl -5 + call _loop + drop 1 + pushr + popr + jmp __55 +__217: + jmp __215 +__214: + pushl -6 + pushc 79 + lt + brf __218 + pushl -5 + call _prog1 + drop 1 + pushr + popr + jmp __55 + jmp __219 +__218: + call _driver + pushr + popr + jmp __55 +__219: +__215: +__207: +__191: + jmp __189 +__188: + pushl -6 + pushc 88 + lt + brf __220 + pushl -6 + pushc 84 + lt + brf __222 + pushl -6 + pushc 82 + lt + brf __224 + pushl -6 + pushc 81 + lt + brf __226 + call _reclaim + pushr + popr + jmp __55 + jmp __227 +__226: + pushl -5 + pushl -4 + call _save + drop 2 + pushr + popr + jmp __55 +__227: + jmp __225 +__224: + pushl -6 + pushc 83 + lt + brf __228 + pushl -5 + pushl -4 + call _load + drop 2 + pushr + popr + jmp __55 + jmp __229 +__228: + call _system + pushr + popr + jmp __55 +__229: +__225: + jmp __223 +__222: + pushl -6 + pushc 86 + lt + brf __230 + pushl -6 + pushc 85 + lt + brf __232 + pushl -5 + pushl -4 + call _xchgpname + drop 2 + pushr + popr + jmp __55 + jmp __233 +__232: + pushl -5 + call _purgename + drop 1 + pushr + popr + jmp __55 +__233: + jmp __231 +__230: + pushl -6 + pushc 87 + lt + brf __234 + pushc 86 + call _execErr + drop 1 + pushr + popr + jmp __55 + jmp __235 +__234: + pushc 87 + call _execErr + drop 1 + pushr + popr + jmp __55 +__235: +__231: +__223: + jmp __221 +__220: + pushl -6 + pushc 92 + lt + brf __236 + pushl -6 + pushc 90 + lt + brf __238 + pushl -6 + pushc 89 + lt + brf __240 + pushc 88 + call _execErr + drop 1 + pushr + popr + jmp __55 + jmp __241 +__240: + pushc 89 + call _execErr + drop 1 + pushr + popr + jmp __55 +__241: + jmp __239 +__238: + pushl -6 + pushc 91 + lt + brf __242 + pushc 90 + call _execErr + drop 1 + pushr + popr + jmp __55 + jmp __243 +__242: + pushc 91 + call _execErr + drop 1 + pushr + popr + jmp __55 +__243: +__239: + jmp __237 +__236: + pushl -6 + pushc 94 + lt + brf __244 + pushl -6 + pushc 93 + lt + brf __246 + pushc 92 + call _execErr + drop 1 + pushr + popr + jmp __55 + jmp __247 +__246: + pushc 93 + call _execErr + drop 1 + pushr + popr + jmp __55 +__247: + jmp __245 +__244: + pushl -6 + pushc 95 + lt + brf __248 + pushc 94 + call _execErr + drop 1 + pushr + popr + jmp __55 + jmp __249 +__248: + pushc 95 + call _execErr + drop 1 + pushr + popr + jmp __55 +__249: +__245: +__237: +__221: +__189: + jmp __187 +__186: + pushl -6 + call _execErr + drop 1 +__187: +__59: +__55: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } car(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_car: + asf 0 + pushl -3 + getf 1 + popr + jmp __250 +__250: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cdr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cdr: + asf 0 + pushl -3 + getf 2 + popr + jmp __251 +__251: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } caar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_caar: + asf 0 + pushl -3 + getf 1 + getf 1 + popr + jmp __252 +__252: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cadr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cadr: + asf 0 + pushl -3 + getf 2 + getf 1 + popr + jmp __253 +__253: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cdar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cdar: + asf 0 + pushl -3 + getf 1 + getf 2 + popr + jmp __254 +__254: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cddr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cddr: + asf 0 + pushl -3 + getf 2 + getf 2 + popr + jmp __255 +__255: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } caaar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_caaar: + asf 0 + pushl -3 + getf 1 + getf 1 + getf 1 + popr + jmp __256 +__256: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } caadr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_caadr: + asf 0 + pushl -3 + getf 2 + getf 1 + getf 1 + popr + jmp __257 +__257: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cadar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cadar: + asf 0 + pushl -3 + getf 1 + getf 2 + getf 1 + popr + jmp __258 +__258: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } caddr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_caddr: + asf 0 + pushl -3 + getf 2 + getf 2 + getf 1 + popr + jmp __259 +__259: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cdaar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cdaar: + asf 0 + pushl -3 + getf 1 + getf 1 + getf 2 + popr + jmp __260 +__260: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cdadr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cdadr: + asf 0 + pushl -3 + getf 2 + getf 1 + getf 2 + popr + jmp __261 +__261: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cddar(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cddar: + asf 0 + pushl -3 + getf 1 + getf 2 + getf 2 + popr + jmp __262 +__262: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cdddr(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cdddr: + asf 0 + pushl -3 + getf 2 + getf 2 + getf 2 + popr + jmp __263 +__263: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cons(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cons: + asf 0 + pushl -4 + pushl -3 + call _makeNode + drop 2 + pushr + popr + jmp __264 +__264: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } list(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_list: + asf 2 + pushg 10 + pushg 10 + call _makeNode + drop 2 + pushr + popl 0 + pushl 0 + pushl 0 + putf 1 + jmp __267 +__266: + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 1 + pushl 0 + getf 1 + pushl 1 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 0 + pushl 0 + getf 1 + getf 2 + putf 1 + pushl -3 + getf 2 + popl -3 +__267: + pushl -3 + getf 0 + pushg 2 + eq + brt __266 +__268: + pushl 0 + getf 1 + pushl -3 + putf 2 + pushl 0 + getf 2 + popr + jmp __265 +__265: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } reverse(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_reverse: + asf 1 + pushl -3 + popl 0 + jmp __271 +__270: + pushl -4 + getf 1 + pushl 0 + call _makeNode + drop 2 + pushr + popl 0 + pushl -4 + getf 2 + popl -4 +__271: + pushl -4 + getf 0 + pushg 2 + eq + brt __270 +__272: + pushl 0 + popr + jmp __269 +__269: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } oblist() +// +_oblist: + asf 0 + pushg 8 + call _copyTree + drop 1 + pushr + popr + jmp __273 +__273: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } rplaca(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_rplaca: + asf 0 + pushl -4 + pushl -3 + putf 1 + pushl -4 + popr + jmp __274 +__274: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } rplacd(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_rplacd: + asf 0 + pushl -4 + pushl -3 + putf 2 + pushl -4 + popr + jmp __275 +__275: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } nconc(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_nconc: + asf 1 + pushl -4 + getf 0 + pushg 2 + ne + brf __277 + pushl -3 + popr + jmp __276 +__277: + pushl -4 + popl 0 + jmp __279 +__278: + pushl 0 + getf 2 + popl 0 +__279: + pushl 0 + getf 2 + getf 0 + pushg 2 + eq + brt __278 +__280: + pushl 0 + pushl -3 + putf 2 + pushl -4 + popr + jmp __276 +__276: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } name(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_name: + asf 0 + pushl -3 + getf 0 + pushg 0 + eq + brf __282 + pushg 11 + popr + jmp __281 +__282: + pushg 10 + popr + jmp __281 +__281: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } numberp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_numberp: + asf 0 + pushl -3 + getf 0 + pushg 1 + eq + brf __284 + pushg 11 + popr + jmp __283 +__284: + pushg 10 + popr + jmp __283 +__283: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } atom(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_atom: + asf 0 + pushl -3 + getf 0 + pushg 2 + ne + brf __286 + pushg 11 + popr + jmp __285 +__286: + pushg 10 + popr + jmp __285 +__285: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } null(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_null: + asf 0 + pushl -3 + pushg 10 + refeq + brf __288 + pushg 11 + popr + jmp __287 +__288: + pushg 10 + popr + jmp __287 +__287: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } plusp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_plusp: + asf 0 + pushl -3 + getf 0 + pushg 1 + eq + dup + brf __291 + drop 1 + pushl -3 + getf 5 + pushc 0 + gt +__291: + brf __290 + pushg 11 + popr + jmp __289 +__290: + pushg 10 + popr + jmp __289 +__289: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } minusp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_minusp: + asf 0 + pushl -3 + getf 0 + pushg 1 + eq + dup + brf __294 + drop 1 + pushl -3 + getf 5 + pushc 0 + lt +__294: + brf __293 + pushg 11 + popr + jmp __292 +__293: + pushg 10 + popr + jmp __292 +__292: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } zerop(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_zerop: + asf 0 + pushl -3 + getf 0 + pushg 1 + eq + dup + brf __297 + drop 1 + pushl -3 + getf 5 + pushc 0 + eq +__297: + brf __296 + pushg 11 + popr + jmp __295 +__296: + pushg 10 + popr + jmp __295 +__295: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } even(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_even: + asf 0 + pushl -3 + getf 0 + pushg 1 + eq + dup + brf __300 + drop 1 + pushl -3 + getf 5 + pushc 2 + mod + pushc 0 + eq +__300: + brf __299 + pushg 11 + popr + jmp __298 +__299: + pushg 10 + popr + jmp __298 +__298: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } eq(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_eq: + asf 0 + pushl -4 + pushl -3 + refeq + brf __302 + pushg 11 + popr + jmp __301 +__302: + pushl -4 + getf 0 + pushg 1 + eq + dup + brf __305 + drop 1 + pushl -3 + getf 0 + pushg 1 + eq +__305: + dup + brf __304 + drop 1 + pushl -4 + getf 5 + pushl -3 + getf 5 + eq +__304: + brf __303 + pushg 11 + popr + jmp __301 +__303: + pushg 10 + popr + jmp __301 +__301: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } equal(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_equal: + asf 0 + jmp __308 +__307: + pushl -4 + getf 1 + pushl -3 + getf 1 + call _equal + drop 2 + pushr + pushg 10 + refeq + brf __310 + pushg 10 + popr + jmp __306 +__310: + pushl -4 + getf 2 + popl -4 + pushl -3 + getf 2 + popl -3 +__308: + pushl -4 + getf 0 + pushg 2 + eq + dup + brf __311 + drop 1 + pushl -3 + getf 0 + pushg 2 + eq +__311: + brt __307 +__309: + pushl -4 + pushl -3 + call _eq + drop 2 + pushr + popr + jmp __306 +__306: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } member(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_member: + asf 0 + jmp __314 +__313: + pushl -4 + pushl -3 + getf 1 + call _equal + drop 2 + pushr + pushg 11 + refeq + brf __316 + pushg 11 + popr + jmp __312 +__316: + pushl -3 + getf 2 + popl -3 +__314: + pushl -3 + getf 0 + pushg 2 + eq + brt __313 +__315: + pushl -3 + popr + jmp __312 +__312: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } greaterp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_greaterp: + asf 0 + pushl -4 + getf 0 + pushg 1 + eq + dup + brf __320 + drop 1 + pushl -3 + getf 0 + pushg 1 + eq +__320: + dup + brf __319 + drop 1 + pushl -4 + getf 5 + pushl -3 + getf 5 + gt +__319: + brf __318 + pushg 11 + popr + jmp __317 +__318: + pushg 10 + popr + jmp __317 +__317: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } lessp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_lessp: + asf 0 + pushl -4 + getf 0 + pushg 1 + eq + dup + brf __324 + drop 1 + pushl -3 + getf 0 + pushg 1 + eq +__324: + dup + brf __323 + drop 1 + pushl -4 + getf 5 + pushl -3 + getf 5 + lt +__323: + brf __322 + pushg 11 + popr + jmp __321 +__322: + pushg 10 + popr + jmp __321 +__321: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } orderp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_orderp: + asf 1 + pushl -4 + getf 0 + pushg 2 + eq + brf __326 + pushg 10 + popr + jmp __325 +__326: + pushl -3 + getf 0 + pushg 2 + eq + brf __327 + pushg 11 + popr + jmp __325 +__327: + pushl -4 + getf 0 + pushg 1 + eq + dup + brf __329 + drop 1 + pushl -3 + getf 0 + pushg 1 + eq +__329: + brf __328 + pushl -4 + getf 5 + pushl -3 + getf 5 + lt + brf __330 + pushg 11 + popr + jmp __325 +__330: + pushg 10 + popr + jmp __325 +__328: + pushl -4 + getf 0 + pushg 1 + eq + brf __331 + pushg 11 + popr + jmp __325 +__331: + pushl -3 + getf 0 + pushg 1 + eq + brf __332 + pushg 10 + popr + jmp __325 +__332: + pushg 8 + popl 0 + jmp __334 +__333: + pushl 0 + getf 1 + pushl -4 + refeq + brf __336 + pushg 10 + popr + jmp __325 +__336: + pushl 0 + getf 1 + pushl -3 + refeq + brf __337 + pushg 11 + popr + jmp __325 +__337: + pushl 0 + getf 2 + popl 0 +__334: + pushl 0 + getf 0 + pushg 2 + eq + brt __333 +__335: + pushg 10 + popr + jmp __325 +__325: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } not(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_not: + asf 0 + pushl -3 + pushg 10 + refeq + brf __339 + pushg 11 + popr + jmp __338 +__339: + pushg 10 + popr + jmp __338 +__338: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } and(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_and: + asf 0 + jmp __342 +__341: + pushl -3 + getf 1 + call _eval + drop 1 + pushr + pushg 10 + refeq + brf __344 + pushg 10 + popr + jmp __340 +__344: + pushl -3 + getf 2 + popl -3 +__342: + pushl -3 + getf 0 + pushg 2 + eq + brt __341 +__343: + pushg 11 + popr + jmp __340 +__340: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } or(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_or: + asf 0 + jmp __347 +__346: + pushl -3 + getf 1 + call _eval + drop 1 + pushr + pushg 10 + refne + brf __349 + pushg 11 + popr + jmp __345 +__349: + pushl -3 + getf 2 + popl -3 +__347: + pushl -3 + getf 0 + pushg 2 + eq + brt __346 +__348: + pushg 10 + popr + jmp __345 +__345: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } set(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_set: + asf 0 + pushl -4 + pushl -3 + putf 1 + pushl -3 + popr + jmp __350 +__350: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } setq(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_setq: + asf 1 + pushl -3 + getf 2 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl -3 + getf 1 + pushl 0 + putf 1 + pushl 0 + popr + jmp __351 +__351: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } pop(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_pop: + asf 1 + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl -3 + getf 1 + pushl 0 + getf 2 + putf 1 + pushl 0 + getf 1 + popr + jmp __352 +__352: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } push(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_push: + asf 3 + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl -3 + getf 2 + getf 1 + call _eval + drop 1 + pushr + popl 1 + pushl 0 + pushl 1 + call _makeNode + drop 2 + pushr + popl 2 + pushl -3 + getf 2 + getf 1 + pushl 2 + putf 1 + pushl 2 + popr + jmp __353 +__353: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } assoc(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_assoc: + asf 0 + jmp __356 +__355: + pushl -3 + getf 1 + getf 0 + pushg 2 + eq + dup + brf __359 + drop 1 + pushl -3 + getf 1 + getf 1 + pushl -4 + call _equal + drop 2 + pushr + pushg 11 + refeq +__359: + brf __358 + pushl -3 + getf 1 + popr + jmp __354 +__358: + pushl -3 + getf 2 + popl -3 +__356: + pushl -3 + getf 0 + pushg 2 + eq + brt __355 +__357: + pushl -3 + popr + jmp __354 +__354: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } get(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_get: + asf 1 + pushl -3 + pushl -4 + getf 2 + call _assoc + drop 2 + pushr + popl 0 + pushl 0 + getf 0 + pushg 2 + ne + brf __361 + pushg 10 + popr + jmp __360 +__361: + pushl 0 + getf 2 + popr + jmp __360 +__360: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } put(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_put: + asf 1 + pushl -4 + pushl -5 + getf 2 + call _assoc + drop 2 + pushr + popl 0 + pushl 0 + getf 0 + pushg 2 + ne + brf __363 + pushl -4 + pushl -3 + call _makeNode + drop 2 + pushr + popl 0 + pushl -5 + pushl 0 + pushl -5 + getf 2 + call _makeNode + drop 2 + pushr + putf 2 + pushl -3 + popr + jmp __362 +__363: + pushl 0 + pushl -3 + putf 2 + pushl -3 + popr + jmp __362 +__362: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } remprop(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_remprop: + asf 0 + jmp __366 +__365: + pushl -4 + getf 2 + getf 1 + getf 1 + pushl -3 + call _equal + drop 2 + pushr + pushg 11 + refeq + brf __368 + pushl -4 + getf 2 + getf 1 + getf 2 + popl -3 + pushl -4 + pushl -4 + getf 2 + getf 2 + putf 2 + pushl -3 + popr + jmp __364 +__368: + pushl -4 + getf 2 + popl -4 +__366: + pushl -4 + getf 2 + getf 0 + pushg 2 + eq + brt __365 +__367: + pushl -4 + getf 2 + popr + jmp __364 +__364: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } flagp(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_flagp: + asf 0 + pushl -3 + pushl -4 + getf 2 + call _member + drop 2 + pushr + popr + jmp __369 +__369: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } flag(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_flag: + asf 0 + pushl -3 + pushl -4 + getf 2 + call _member + drop 2 + pushr + pushg 11 + refeq + brf __371 + pushl -3 + popr + jmp __370 +__371: + pushl -4 + pushl -3 + pushl -4 + getf 2 + call _makeNode + drop 2 + pushr + putf 2 + pushl -3 + popr + jmp __370 +__370: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } remflag(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_remflag: + asf 0 + jmp __374 +__373: + pushl -3 + pushl -4 + getf 2 + getf 1 + call _equal + drop 2 + pushr + pushg 11 + refeq + brf __376 + pushl -4 + pushl -4 + getf 2 + getf 2 + putf 2 + pushl -3 + popr + jmp __372 +__376: + pushl -4 + getf 2 + popl -4 +__374: + pushl -4 + getf 2 + getf 0 + pushg 2 + eq + brt __373 +__375: + pushg 10 + popr + jmp __372 +__372: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } getd(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_getd: + asf 0 + pushl -3 + getf 0 + pushg 0 + ne + brf __378 + pushg 10 + popr + jmp __377 +__378: + pushl -3 + getf 3 + call _copyTree + drop 1 + pushr + popr + jmp __377 +__377: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } putd(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_putd: + asf 0 + pushl -4 + getf 0 + pushg 0 + ne + brf __380 + pushg 10 + popr + jmp __379 +__380: + pushl -4 + pushl -3 + call _copyTree + drop 1 + pushr + putf 3 + pushl -3 + popr + jmp __379 +__379: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } movd(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_movd: + asf 0 + pushl -4 + getf 0 + pushg 0 + ne + dup + brt __383 + drop 1 + pushl -3 + getf 0 + pushg 0 + ne +__383: + brf __382 + pushg 10 + popr + jmp __381 +__382: + pushl -3 + pushl -4 + getf 3 + putf 3 + pushl -3 + getf 3 + call _copyTree + drop 1 + pushr + popr + jmp __381 +__381: + rsf + ret + +// +// void addNumberToStringBuffer(record { String str; Integer len; }, Integer) +// +_addNumberToStringBuffer: + asf 2 + pushl -3 + pushc 0 + lt + brf __385 + pushl -4 + pushc 45 + call _addCharToStringBuffer + drop 2 + pushc 0 + pushl -3 + sub + popl -3 +__385: + pushl -3 + pushg 106 + div + popl 0 + pushl 0 + pushc 0 + ne + brf __386 + pushl -4 + pushl 0 + call _addNumberToStringBuffer + drop 2 +__386: + pushl -3 + pushg 106 + mod + popl 1 + pushl 1 + pushc 10 + lt + brf __387 + pushl -4 + pushc 48 + call _char2int + drop 1 + pushr + pushl 1 + add + call _int2char + drop 1 + pushr + call _addCharToStringBuffer + drop 2 + jmp __388 +__387: + pushl 0 + pushc 0 + eq + brf __389 + pushl -4 + pushc 48 + call _addCharToStringBuffer + drop 2 +__389: + pushl -4 + pushc 65 + call _char2int + drop 1 + pushr + pushl 1 + pushc 10 + sub + add + call _int2char + drop 1 + pushr + call _addCharToStringBuffer + drop 2 +__388: +__384: + rsf + ret + +// +// Integer countName(Character[]) +// +_countName: + asf 5 + pushc 0 + popl 0 + pushl -3 + getsz + popl 1 + pushc 0 + popl 2 + pushc 0 + popl 4 + jmp __392 +__391: + pushl -3 + pushl 2 + getfa + popl 3 + pushg 86 + getf 1 + pushg 10 + refeq + dup + brf __396 + drop 1 + pushl 3 + call _isSpecial + drop 1 + pushr +__396: + dup + brf __395 + drop 1 + pushc 1 + pushl 4 + sub +__395: + brf __394 + pushc 1 + popl 4 + pushl 0 + pushc 1 + add + popl 0 +__394: + pushl 0 + pushc 1 + add + popl 0 + pushl 3 + pushc 34 + eq + dup + brf __398 + drop 1 + pushl 4 +__398: + brf __397 + pushl 0 + pushc 1 + add + popl 0 +__397: + pushl 2 + pushc 1 + add + popl 2 +__392: + pushl 2 + pushl 1 + lt + brt __391 +__393: + pushl 4 + brf __399 + pushl 0 + pushc 1 + add + popl 0 +__399: + pushl 0 + popr + jmp __390 +__390: + rsf + ret + +// +// Integer countNumber(Integer) +// +_countNumber: + asf 3 + pushc 0 + popl 0 + pushl -3 + pushc 0 + lt + brf __401 + pushl 0 + pushc 1 + add + popl 0 + pushc 0 + pushl -3 + sub + popl -3 +__401: + pushl -3 + pushg 106 + div + popl 1 + pushl 1 + pushc 0 + ne + brf __402 + pushl 0 + pushl 1 + call _countNumber + drop 1 + pushr + add + popl 0 +__402: + pushl -3 + pushg 106 + mod + popl 2 + pushl 1 + pushc 0 + eq + dup + brf __404 + drop 1 + pushl 2 + pushc 10 + ge +__404: + brf __403 + pushl 0 + pushc 1 + add + popl 0 +__403: + pushl 0 + pushc 1 + add + popl 0 + pushl 0 + popr + jmp __400 +__400: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } pack(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_pack: + asf 2 + pushc 20 + call _newStringBuffer + drop 1 + pushr + popl 0 + jmp __407 +__406: + pushl -3 + getf 1 + getf 0 + pushg 0 + eq + brf __409 + pushl 0 + pushl -3 + getf 1 + getf 4 + call _addStringToStringBuffer + drop 2 + jmp __410 +__409: + pushl -3 + getf 1 + getf 0 + pushg 1 + eq + brf __411 + pushl 0 + pushl -3 + getf 1 + getf 5 + call _addNumberToStringBuffer + drop 2 +__411: +__410: + pushl -3 + getf 2 + popl -3 +__407: + pushl -3 + getf 0 + pushg 2 + eq + brt __406 +__408: + pushl 0 + call _stringBufferToString + drop 1 + pushr + popl 1 + pushl 1 + call _searchOblist + drop 1 + pushr + popr + jmp __405 +__405: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } unpack(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_unpack: + asf 5 + pushc 20 + call _newStringBuffer + drop 1 + pushr + popl 0 + pushl -3 + getf 0 + pushg 0 + eq + brf __413 + pushl 0 + pushl -3 + getf 4 + call _addStringToStringBuffer + drop 2 + jmp __414 +__413: + pushl -3 + getf 0 + pushg 1 + eq + brf __415 + pushl 0 + pushl -3 + getf 5 + call _addNumberToStringBuffer + drop 2 + jmp __416 +__415: + pushg 10 + popr + jmp __412 +__416: +__414: + pushl 0 + call _stringBufferToString + drop 1 + pushr + popl 1 + pushg 10 + pushg 10 + call _makeNode + drop 2 + pushr + popl 3 + pushl 3 + pushl 3 + putf 1 + pushc 0 + popl 2 + jmp __418 +__417: + pushl 1 + pushl 2 + getfa + call _toString + drop 1 + pushr + call _searchOblist + drop 1 + pushr + popl 4 + pushl 3 + getf 1 + pushl 4 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 3 + pushl 3 + getf 1 + getf 2 + putf 1 + pushl 2 + pushc 1 + add + popl 2 +__418: + pushl 2 + pushl 1 + getsz + lt + brt __417 +__419: + pushl 3 + getf 2 + popr + jmp __412 +__412: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } length(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_length: + asf 1 + pushl -3 + getf 0 + pushg 0 + eq + brf __421 + pushl -3 + getf 4 + call _countName + drop 1 + pushr + call _makeNumber + drop 1 + pushr + popr + jmp __420 +__421: + pushl -3 + getf 0 + pushg 1 + eq + brf __422 + pushl -3 + getf 5 + call _countNumber + drop 1 + pushr + call _makeNumber + drop 1 + pushr + popr + jmp __420 +__422: + pushc 0 + popl 0 + jmp __424 +__423: + pushl 0 + pushc 1 + add + popl 0 + pushl -3 + getf 2 + popl -3 +__424: + pushl -3 + getf 0 + pushg 2 + eq + brt __423 +__425: + pushl 0 + call _makeNumber + drop 1 + pushr + popr + jmp __420 +__420: + rsf + ret + +// +// void zeroDivideError() +// +_zeroDivideError: + asf 0 + pushc 17 + newa + dup + pushc 0 + pushc 90 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 82 + putfa + dup + pushc 3 + pushc 79 + putfa + dup + pushc 4 + pushc 32 + putfa + dup + pushc 5 + pushc 68 + putfa + dup + pushc 6 + pushc 105 + putfa + dup + pushc 7 + pushc 118 + putfa + dup + pushc 8 + pushc 105 + putfa + dup + pushc 9 + pushc 100 + putfa + dup + pushc 10 + pushc 101 + putfa + dup + pushc 11 + pushc 32 + putfa + dup + pushc 12 + pushc 69 + putfa + dup + pushc 13 + pushc 114 + putfa + dup + pushc 14 + pushc 114 + putfa + dup + pushc 15 + pushc 111 + putfa + dup + pushc 16 + pushc 114 + putfa + pushc 0 + call _error + drop 2 +__426: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } minus(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_minus: + asf 0 + pushl -3 + getf 0 + pushg 1 + ne + brf __428 + pushg 10 + popr + jmp __427 +__428: + pushc 0 + pushl -3 + getf 5 + sub + call _makeNumber + drop 1 + pushr + popr + jmp __427 +__427: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } plus(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_plus: + asf 0 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __431 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__431: + brf __430 + pushg 10 + popr + jmp __429 +__430: + pushl -4 + getf 5 + pushl -3 + getf 5 + add + call _makeNumber + drop 1 + pushr + popr + jmp __429 +__429: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } difference(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_difference: + asf 0 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __434 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__434: + brf __433 + pushg 10 + popr + jmp __432 +__433: + pushl -4 + getf 5 + pushl -3 + getf 5 + sub + call _makeNumber + drop 1 + pushr + popr + jmp __432 +__432: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } times(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_times: + asf 0 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __437 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__437: + brf __436 + pushg 10 + popr + jmp __435 +__436: + pushl -4 + getf 5 + pushl -3 + getf 5 + mul + call _makeNumber + drop 1 + pushr + popr + jmp __435 +__435: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } quotient(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_quotient: + asf 2 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __440 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__440: + brf __439 + pushg 10 + popr + jmp __438 +__439: + pushl -3 + getf 5 + pushc 0 + eq + brf __441 + call _zeroDivideError + pushg 10 + popr + jmp __438 +__441: + pushl -4 + getf 5 + pushl -3 + getf 5 + div + popl 0 + pushl -4 + getf 5 + pushl -3 + getf 5 + mod + popl 1 + pushl 1 + pushc 0 + lt + brf __442 + pushl 0 + pushc 0 + lt + brf __443 + pushl 0 + pushc 1 + sub + popl 0 + jmp __444 +__443: + pushl 0 + pushc 1 + add + popl 0 +__444: +__442: + pushl 0 + call _makeNumber + drop 1 + pushr + popr + jmp __438 +__438: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } remainder(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_remainder: + asf 2 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __447 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__447: + brf __446 + pushg 10 + popr + jmp __445 +__446: + pushl -3 + getf 5 + pushc 0 + eq + brf __448 + call _zeroDivideError + pushg 10 + popr + jmp __445 +__448: + pushl -4 + getf 5 + pushl -3 + getf 5 + div + popl 0 + pushl -4 + getf 5 + pushl -3 + getf 5 + mod + popl 1 + pushl 1 + pushc 0 + lt + brf __449 + pushl 0 + pushc 0 + lt + brf __450 + pushl 1 + pushl -3 + getf 5 + add + popl 1 + jmp __451 +__450: + pushl 1 + pushl -3 + getf 5 + sub + popl 1 +__451: +__449: + pushl 1 + call _makeNumber + drop 1 + pushr + popr + jmp __445 +__445: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } divide(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_divide: + asf 2 + pushl -4 + getf 0 + pushg 1 + ne + dup + brt __454 + drop 1 + pushl -3 + getf 0 + pushg 1 + ne +__454: + brf __453 + pushg 10 + popr + jmp __452 +__453: + pushl -3 + getf 5 + pushc 0 + eq + brf __455 + call _zeroDivideError + pushg 10 + popr + jmp __452 +__455: + pushl -4 + getf 5 + pushl -3 + getf 5 + div + popl 0 + pushl -4 + getf 5 + pushl -3 + getf 5 + mod + popl 1 + pushl 1 + pushc 0 + lt + brf __456 + pushl 0 + pushc 0 + lt + brf __457 + pushl 0 + pushc 1 + sub + popl 0 + pushl 1 + pushl -3 + getf 5 + add + popl 1 + jmp __458 +__457: + pushl 0 + pushc 1 + add + popl 0 + pushl 1 + pushl -3 + getf 5 + sub + popl 1 +__458: +__456: + pushl 0 + call _makeNumber + drop 1 + pushr + pushl 1 + call _makeNumber + drop 1 + pushr + call _makeNode + drop 2 + pushr + popr + jmp __452 +__452: + rsf + ret + +// +// void unread(Character) +// +_unread: + asf 0 + pushc 1 + popg 108 + pushl -3 + popg 109 +__459: + rsf + ret + +// +// Character readChar() +// +_readChar: + asf 1 + pushg 108 + brf __461 + pushc 0 + popg 108 + pushg 109 + popr + jmp __460 +__461: + pushg 79 + getf 1 + pushg 10 + refeq + brf __462 + pushg 82 + getf 1 + pushg 10 + refeq + brf __464 + call _readCharacter + pushr + popl 0 + jmp __465 +__464: + call _readCharacter + pushr + popl 0 +__465: + jmp __463 +__462: + pushc 32 + popl 0 + pushg 83 + getf 1 + pushg 10 + refne + brf __466 + pushl 0 + call _printChar + drop 1 +__466: +__463: + pushg 81 + getf 1 + pushg 10 + refeq + brf __467 + pushl 0 + call _toUpper + drop 1 + pushr + popl 0 +__467: + pushl 0 + popr + jmp __460 +__460: + rsf + ret + +// +// Character[] readToken(Boolean[], Boolean[]) +// +_readToken: + asf 3 + pushc 0 + popl 0 + call _readChar + pushr + popl 1 + jmp __470 +__469: + pushl 1 + pushc 37 + eq + brf __472 + jmp __474 +__473: +__474: + call _readChar + pushr + pushc 37 + ne + brt __473 +__475: +__472: + call _readChar + pushr + popl 1 +__470: + pushl 1 + pushc 37 + eq + dup + brt __476 + drop 1 + pushl -4 + pushl 1 + call _char2int + drop 1 + pushr + getfa +__476: + brt __469 +__471: + pushl -3 + pushl 1 + call _char2int + drop 1 + pushr + getfa + brf __477 + pushc 1 + popg 107 + pushl 1 + call _toString + drop 1 + pushr + popr + jmp __468 +__477: + pushc 20 + call _newStringBuffer + drop 1 + pushr + popl 2 + jmp __479 +__478: + pushl 0 + brf __481 + pushl 1 + pushc 34 + eq + brf __483 + call _readChar + pushr + popl 1 + pushl 1 + pushc 34 + eq + brf __485 + pushl 2 + pushl 1 + call _addCharToStringBuffer + drop 2 + call _readChar + pushr + popl 1 + jmp __486 +__485: + pushc 0 + popl 0 +__486: + jmp __484 +__483: + pushl 2 + pushl 1 + call _addCharToStringBuffer + drop 2 + call _readChar + pushr + popl 1 +__484: + jmp __482 +__481: + pushl 1 + pushc 34 + eq + brf __487 + pushc 1 + popl 0 + call _readChar + pushr + popl 1 + jmp __488 +__487: + pushl 1 + pushc 37 + eq + brf __489 + jmp __492 +__491: +__492: + call _readChar + pushr + pushc 37 + ne + brt __491 +__493: + call _readChar + pushr + popl 1 + jmp __490 +__489: + pushl -4 + pushl 1 + call _char2int + drop 1 + pushr + getfa + dup + brt __496 + drop 1 + pushl -3 + pushl 1 + call _char2int + drop 1 + pushr + getfa +__496: + brf __494 + pushl 1 + call _unread + drop 1 + pushc 0 + popg 107 + pushl 2 + call _stringBufferToString + drop 1 + pushr + popr + jmp __468 + jmp __495 +__494: + pushl 2 + pushl 1 + call _addCharToStringBuffer + drop 2 + call _readChar + pushr + popl 1 +__495: +__490: +__488: +__482: +__479: + pushc 1 + brt __478 +__480: +__468: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } tokenToAtom(Character[]) +// +_tokenToAtom: + asf 7 + pushc 1 + popl 0 + pushc 0 + popl 1 + pushc 0 + popl 2 + pushc 0 + popl 3 + pushl 3 + pushl -3 + getsz + lt + dup + brf __499 + drop 1 + pushl -3 + pushl 3 + getfa + pushc 45 + eq +__499: + brf __498 + pushc 1 + popl 1 + pushl 3 + pushc 1 + add + popl 3 +__498: + pushl 3 + pushl -3 + getsz + lt + dup + brf __502 + drop 1 + pushl -3 + pushl 3 + getfa + call _isDigit + drop 1 + pushr +__502: + brf __500 + jmp __504 +__503: + pushl -3 + pushl 3 + getfa + popl 4 + pushl 3 + pushc 1 + add + popl 3 + pushl 4 + call _isDigit + drop 1 + pushr + brf __506 + pushl 4 + call _char2int + drop 1 + pushr + pushc 48 + call _char2int + drop 1 + pushr + sub + popl 5 + pushl 5 + pushg 106 + lt + brf __508 + pushl 2 + pushg 106 + mul + pushl 5 + add + popl 2 + jmp __509 +__508: + pushc 0 + popl 0 + jmp __505 +__509: + jmp __507 +__506: + pushl 4 + call _isAlpha + drop 1 + pushr + brf __510 + pushl 4 + call _toUpper + drop 1 + pushr + popl 4 + pushl 4 + call _char2int + drop 1 + pushr + pushc 65 + call _char2int + drop 1 + pushr + sub + popl 5 + pushl 5 + pushg 106 + lt + brf __512 + pushl 2 + pushg 106 + mul + pushl 5 + add + popl 2 + jmp __513 +__512: + pushc 0 + popl 0 + jmp __505 +__513: + jmp __511 +__510: + pushc 0 + popl 0 + jmp __505 +__511: +__507: +__504: + pushl 3 + pushl -3 + getsz + lt + brt __503 +__505: + jmp __501 +__500: + pushc 0 + popl 0 +__501: + pushl 0 + brf __514 + pushl 1 + brf __516 + pushc 0 + pushl 2 + sub + popl 2 +__516: + pushl 2 + call _makeNumber + drop 1 + pushr + popl 6 + jmp __515 +__514: + pushl -3 + call _searchOblist + drop 1 + pushr + popl 6 +__515: + pushg 80 + pushl 6 + putf 1 + pushl 6 + popr + jmp __497 +__497: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } read0(Character[]) +// +_read0: + asf 1 + jmp __519 +__518: + pushc 1 + pushg 107 + sub + brf __521 + pushl -3 + call _tokenToAtom + drop 1 + pushr + popr + jmp __517 +__521: + pushl -3 + pushc 0 + getfa + popl 0 + pushl 0 + pushc 40 + eq + brf __522 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + pushl -3 + call _readList + drop 1 + pushr + popr + jmp __517 + jmp __523 +__522: + pushl 0 + pushc 91 + eq + brf __524 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + pushl -3 + call _readBracket + drop 1 + pushr + popr + jmp __517 + jmp __525 +__524: + pushl 0 + pushc 41 + eq + dup + brt __529 + drop 1 + pushl 0 + pushc 93 + eq +__529: + dup + brt __528 + drop 1 + pushl 0 + pushc 46 + eq +__528: + brf __526 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + jmp __527 +__526: + pushc 20 + newa + dup + pushc 0 + pushc 105 + putfa + dup + pushc 1 + pushc 110 + putfa + dup + pushc 2 + pushc 116 + putfa + dup + pushc 3 + pushc 101 + putfa + dup + pushc 4 + pushc 114 + putfa + dup + pushc 5 + pushc 110 + putfa + dup + pushc 6 + pushc 97 + putfa + dup + pushc 7 + pushc 108 + putfa + dup + pushc 8 + pushc 32 + putfa + dup + pushc 9 + pushc 114 + putfa + dup + pushc 10 + pushc 101 + putfa + dup + pushc 11 + pushc 97 + putfa + dup + pushc 12 + pushc 100 + putfa + dup + pushc 13 + pushc 48 + putfa + dup + pushc 14 + pushc 32 + putfa + dup + pushc 15 + pushc 101 + putfa + dup + pushc 16 + pushc 114 + putfa + dup + pushc 17 + pushc 114 + putfa + dup + pushc 18 + pushc 111 + putfa + dup + pushc 19 + pushc 114 + putfa + pushc 1 + call _error + drop 2 +__527: +__525: +__523: +__519: + pushc 1 + brt __518 +__520: +__517: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } readList(Character[]) +// +_readList: + asf 2 + pushg 10 + pushg 10 + call _makeNode + drop 2 + pushr + popl 0 + pushl 0 + pushl 0 + putf 1 + jmp __532 +__531: + pushg 107 + dup + brf __536 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 41 + eq +__536: + brf __534 + pushl 0 + getf 2 + popr + jmp __530 + jmp __535 +__534: + pushg 107 + dup + brf __539 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 93 + eq +__539: + brf __537 + pushc 93 + call _unread + drop 1 + pushl 0 + getf 2 + popr + jmp __530 + jmp __538 +__537: + pushg 107 + dup + brf __542 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 46 + eq +__542: + brf __540 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + pushl -3 + call _read0 + drop 1 + pushr + popl 1 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + pushg 107 + dup + brf __545 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 41 + eq +__545: + brf __543 + pushl 0 + getf 1 + pushl 1 + putf 2 + pushl 0 + getf 2 + popr + jmp __530 + jmp __544 +__543: + pushg 107 + dup + brf __548 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 93 + eq +__548: + brf __546 + pushc 93 + call _unread + drop 1 + pushl 0 + getf 1 + pushl 1 + putf 2 + pushl 0 + getf 2 + popr + jmp __530 + jmp __547 +__546: + pushl 0 + getf 1 + pushl 1 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 0 + pushl 0 + getf 1 + getf 2 + putf 1 +__547: +__544: + jmp __541 +__540: + pushl -3 + call _read0 + drop 1 + pushr + popl 1 + pushl 0 + getf 1 + pushl 1 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 0 + pushl 0 + getf 1 + getf 2 + putf 1 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 +__541: +__538: +__535: +__532: + pushc 1 + brt __531 +__533: +__530: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } readBracket(Character[]) +// +_readBracket: + asf 2 + pushl -3 + call _readList + drop 1 + pushr + popl 0 + jmp __551 +__550: + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl -3 + pushg 107 + dup + brf __555 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 41 + eq +__555: + brf __553 + pushl 0 + popr + jmp __549 + jmp __554 +__553: + pushg 107 + dup + brf __558 + drop 1 + pushl -3 + pushc 0 + getfa + pushc 93 + eq +__558: + brf __556 + pushl 0 + popr + jmp __549 + jmp __557 +__556: + pushl -3 + call _readList + drop 1 + pushr + popl 1 + pushl 0 + pushl 1 + call _makeNode + drop 2 + pushr + popl 0 +__557: +__554: +__551: + pushc 1 + brt __550 +__552: +__549: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } rds(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_rds: + asf 0 + pushg 10 + popr + jmp __559 +__559: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } ratom() +// +_ratom: + asf 1 + pushg 3 + pushg 4 + call _readToken + drop 2 + pushr + popl 0 + pushl 0 + call _tokenToAtom + drop 1 + pushr + popr + jmp __560 +__560: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } read() +// +_read: + asf 1 + pushg 5 + pushg 6 + call _readToken + drop 2 + pushr + popl 0 + pushl 0 + call _read0 + drop 1 + pushr + popr + jmp __561 +__561: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } readch() +// +_readch: + asf 4 + call _readChar + pushr + popl 0 + pushl 0 + call _isDigit + drop 1 + pushr + brf __563 + pushl 0 + call _char2int + drop 1 + pushr + pushc 48 + call _char2int + drop 1 + pushr + sub + popl 1 + pushl 1 + pushg 106 + lt + brf __565 + pushl 1 + call _makeNumber + drop 1 + pushr + popl 3 + jmp __566 +__565: + pushl 0 + call _toString + drop 1 + pushr + popl 2 + pushl 2 + call _searchOblist + drop 1 + pushr + popl 3 +__566: + jmp __564 +__563: + pushl 0 + call _toString + drop 1 + pushr + popl 2 + pushl 2 + call _searchOblist + drop 1 + pushr + popl 3 +__564: + pushg 80 + pushl 3 + putf 1 + pushl 3 + popr + jmp __562 +__562: + rsf + ret + +// +// void putConsole(Character) +// +_putConsole: + asf 0 + pushl -3 + call _writeCharacter + drop 1 +__567: + rsf + ret + +// +// void printChar(Character) +// +_printChar: + asf 1 + pushg 85 + getf 1 + pushg 10 + refeq + brf __569 + pushl -3 + call _toLower + drop 1 + pushr + popl -3 +__569: + pushg 84 + getf 1 + pushg 10 + refeq + brf __570 + pushl -3 + call _putConsole + drop 1 + jmp __571 +__570: + pushg 83 + getf 1 + pushg 10 + refne + brf __572 + pushl -3 + call _putConsole + drop 1 +__572: +__571: + pushl -3 + call _char2int + drop 1 + pushr + popl 0 + pushl 0 + pushc 8 + eq + brf __573 + pushg 104 + pushc 1 + sub + popg 104 + jmp __574 +__573: + pushl 0 + pushc 9 + eq + brf __575 + pushg 104 + pushc 8 + add + pushc 8 + div + pushc 8 + mul + popg 104 + jmp __576 +__575: + pushl 0 + pushc 10 + eq + brf __577 + pushc 0 + popg 104 + jmp __578 +__577: + pushl 0 + pushc 11 + eq + brf __579 + pushc 0 + popg 104 + jmp __580 +__579: + pushl 0 + pushc 12 + eq + brf __581 + pushc 0 + popg 104 + jmp __582 +__581: + pushl 0 + pushc 13 + eq + brf __583 + pushc 0 + popg 104 + jmp __584 +__583: + pushg 104 + pushc 1 + add + popg 104 +__584: +__582: +__580: +__578: +__576: +__574: +__568: + rsf + ret + +// +// Boolean isSpecial(Character) +// +_isSpecial: + asf 1 + pushl -3 + call _char2int + drop 1 + pushr + popl 0 + pushg 7 + pushl 0 + getfa + dup + brt __587 + drop 1 + pushg 6 + pushl 0 + getfa +__587: + dup + brt __586 + drop 1 + pushg 5 + pushl 0 + getfa +__586: + popr + jmp __585 +__585: + rsf + ret + +// +// void printName(Character[]) +// +_printName: + asf 4 + pushl -3 + getsz + popl 0 + pushc 0 + popl 1 + pushc 0 + popl 3 + jmp __590 +__589: + pushl -3 + pushl 1 + getfa + popl 2 + pushg 86 + getf 1 + pushg 10 + refeq + dup + brf __594 + drop 1 + pushl 2 + call _isSpecial + drop 1 + pushr +__594: + dup + brf __593 + drop 1 + pushc 1 + pushl 3 + sub +__593: + brf __592 + pushc 1 + popl 3 + pushc 34 + call _printChar + drop 1 +__592: + pushl 2 + call _printChar + drop 1 + pushl 2 + pushc 34 + eq + dup + brf __596 + drop 1 + pushl 3 +__596: + brf __595 + pushc 34 + call _printChar + drop 1 +__595: + pushl 1 + pushc 1 + add + popl 1 +__590: + pushl 1 + pushl 0 + lt + brt __589 +__591: + pushl 3 + brf __597 + pushc 34 + call _printChar + drop 1 +__597: +__588: + rsf + ret + +// +// void printNumber(Integer) +// +_printNumber: + asf 2 + pushl -3 + pushc 0 + lt + brf __599 + pushc 45 + call _printChar + drop 1 + pushc 0 + pushl -3 + sub + popl -3 +__599: + pushl -3 + pushg 106 + div + popl 0 + pushl 0 + pushc 0 + ne + brf __600 + pushl 0 + call _printNumber + drop 1 +__600: + pushl -3 + pushg 106 + mod + popl 1 + pushl 1 + pushc 10 + lt + brf __601 + pushc 48 + call _char2int + drop 1 + pushr + pushl 1 + add + call _int2char + drop 1 + pushr + call _printChar + drop 1 + jmp __602 +__601: + pushl 0 + pushc 0 + eq + brf __603 + pushc 48 + call _printChar + drop 1 +__603: + pushc 65 + call _char2int + drop 1 + pushr + pushl 1 + pushc 10 + sub + add + call _int2char + drop 1 + pushr + call _printChar + drop 1 +__602: +__598: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } wrs(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_wrs: + asf 0 + pushg 10 + popr + jmp __604 +__604: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } print(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_print: + asf 0 + pushl -3 + call _prin1 + drop 1 + pushc 10 + call _printChar + drop 1 + pushl -3 + popr + jmp __605 +__605: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } prin1(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_prin1: + asf 0 + pushl -3 + getf 0 + pushg 0 + eq + brf __607 + pushl -3 + getf 4 + call _printName + drop 1 + pushl -3 + popr + jmp __606 +__607: + pushl -3 + getf 0 + pushg 1 + eq + brf __608 + pushl -3 + getf 5 + call _printNumber + drop 1 + pushl -3 + popr + jmp __606 +__608: + pushc 40 + call _printChar + drop 1 + pushl -3 + getf 1 + call _prin1 + drop 1 + pushl -3 + getf 2 + popl -3 + jmp __610 +__609: + pushc 32 + call _printChar + drop 1 + pushl -3 + getf 1 + call _prin1 + drop 1 + pushl -3 + getf 2 + popl -3 +__610: + pushl -3 + getf 0 + pushg 2 + eq + brt __609 +__611: + pushl -3 + pushg 10 + refne + brf __612 + pushc 32 + call _printChar + drop 1 + pushc 46 + call _printChar + drop 1 + pushc 32 + call _printChar + drop 1 + pushl -3 + call _prin1 + drop 1 +__612: + pushc 41 + call _printChar + drop 1 + pushl -3 + popr + jmp __606 +__606: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } terpri(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_terpri: + asf 1 + pushl -3 + getf 0 + pushg 1 + eq + brf __614 + pushl -3 + getf 5 + popl 0 + pushl 0 + pushc 0 + lt + dup + brt __616 + drop 1 + pushl 0 + pushc 255 + gt +__616: + brf __615 + pushc 10 + call _printChar + drop 1 + pushg 10 + popr + jmp __613 +__615: + jmp __618 +__617: + pushc 10 + call _printChar + drop 1 + pushl 0 + pushc 1 + sub + popl 0 +__618: + pushl 0 + pushc 0 + gt + brt __617 +__619: + pushg 10 + popr + jmp __613 +__614: + pushc 10 + call _printChar + drop 1 + pushg 10 + popr + jmp __613 +__613: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } spaces(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_spaces: + asf 1 + pushl -3 + getf 0 + pushg 1 + eq + brf __621 + pushl -3 + getf 5 + popl 0 + pushl 0 + pushc 0 + lt + dup + brt __623 + drop 1 + pushl 0 + pushc 255 + gt +__623: + brf __622 + pushg 104 + call _makeNumber + drop 1 + pushr + popr + jmp __620 +__622: + jmp __625 +__624: + pushc 32 + call _printChar + drop 1 + pushl 0 + pushc 1 + sub + popl 0 +__625: + pushl 0 + pushc 0 + gt + brt __624 +__626: + pushg 104 + call _makeNumber + drop 1 + pushr + popr + jmp __620 +__621: + pushg 104 + call _makeNumber + drop 1 + pushr + popr + jmp __620 +__620: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } linelength(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_linelength: + asf 2 + pushl -3 + getf 0 + pushg 1 + eq + brf __628 + pushl -3 + getf 5 + popl 0 + pushl 0 + pushc 11 + gt + dup + brf __630 + drop 1 + pushl 0 + pushc 256 + lt +__630: + brf __629 + pushg 105 + call _makeNumber + drop 1 + pushr + popl 1 + pushl 0 + popg 105 + pushl 1 + popr + jmp __627 +__629: + pushg 105 + call _makeNumber + drop 1 + pushr + popr + jmp __627 +__628: + pushg 105 + call _makeNumber + drop 1 + pushr + popr + jmp __627 +__627: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } radix(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_radix: + asf 2 + pushl -3 + getf 0 + pushg 1 + eq + brf __632 + pushl -3 + getf 5 + popl 0 + pushl 0 + pushc 1 + gt + dup + brf __634 + drop 1 + pushl 0 + pushc 37 + lt +__634: + brf __633 + pushg 106 + call _makeNumber + drop 1 + pushr + popl 1 + pushl 0 + popg 106 + pushl 1 + popr + jmp __631 +__633: + pushg 106 + call _makeNumber + drop 1 + pushr + popr + jmp __631 +__632: + pushg 106 + call _makeNumber + drop 1 + pushr + popr + jmp __631 +__631: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } evlis(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_evlis: + asf 2 + pushg 10 + pushg 10 + call _makeNode + drop 2 + pushr + popl 0 + pushl 0 + pushl 0 + putf 1 + jmp __637 +__636: + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 1 + pushl 0 + getf 1 + pushl 1 + pushg 10 + call _makeNode + drop 2 + pushr + putf 2 + pushl 0 + pushl 0 + getf 1 + getf 2 + putf 1 + pushl -3 + getf 2 + popl -3 +__637: + pushl -3 + getf 0 + pushg 2 + eq + brt __636 +__638: + pushl 0 + getf 1 + pushl -3 + putf 2 + pushl 0 + getf 2 + popr + jmp __635 +__635: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } evalbody(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_evalbody: + asf 1 + pushl -4 + popl 0 + jmp __641 +__640: + pushl -3 + getf 1 + getf 0 + pushg 2 + ne + dup + brt __645 + drop 1 + pushl -3 + getf 1 + getf 1 + getf 0 + pushg 2 + ne +__645: + brf __643 + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl -3 + getf 2 + popl -3 + jmp __644 +__643: + pushl -3 + getf 1 + getf 1 + getf 1 + getf 0 + pushg 2 + ne + brf __646 + pushl -3 + getf 1 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl 0 + pushg 10 + refeq + brf __648 + pushl -3 + getf 2 + popl -3 + jmp __649 +__648: + pushl -3 + getf 1 + getf 2 + popl -3 +__649: + jmp __647 +__646: + pushl 0 + pushl -3 + getf 1 + call _evalbody + drop 2 + pushr + popl 0 + pushl -3 + getf 2 + popl -3 +__647: +__644: +__641: + pushl -3 + getf 0 + pushg 2 + eq + brt __640 +__642: + pushl 0 + popr + jmp __639 +__639: + rsf + ret + +// +// void bind(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_bind: + asf 0 + pushl -4 + getf 0 + pushg 2 + ne + brf __651 + pushl -4 + pushg 10 + refne + brf __652 + pushl -4 + getf 1 + pushg 9 + call _makeNode + drop 2 + pushr + popg 9 + pushl -4 + pushl -3 + putf 1 +__652: + jmp __650 +__651: + jmp __654 +__653: + pushl -4 + getf 1 + getf 1 + pushg 9 + call _makeNode + drop 2 + pushr + popg 9 + pushl -4 + getf 1 + pushl -3 + getf 1 + putf 1 + pushl -4 + getf 2 + popl -4 + pushl -3 + getf 2 + popl -3 +__654: + pushl -4 + getf 0 + pushg 2 + eq + dup + brf __656 + drop 1 + pushl -3 + getf 0 + pushg 2 + eq +__656: + brt __653 +__655: + jmp __658 +__657: + pushl -4 + getf 1 + getf 1 + pushg 9 + call _makeNode + drop 2 + pushr + popg 9 + pushl -4 + getf 1 + pushg 10 + putf 1 + pushl -4 + getf 2 + popl -4 +__658: + pushl -4 + getf 0 + pushg 2 + eq + brt __657 +__659: +__650: + rsf + ret + +// +// void unbind(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_unbind: + asf 1 + pushl -3 + getf 0 + pushg 2 + ne + brf __661 + pushl -3 + pushg 10 + refne + brf __662 + pushl -3 + pushg 9 + getf 1 + putf 1 + pushg 9 + getf 2 + popg 9 +__662: + jmp __660 +__661: + pushg 10 + popl 0 + jmp __664 +__663: + pushl -3 + getf 1 + pushl 0 + call _makeNode + drop 2 + pushr + popl 0 + pushl -3 + getf 2 + popl -3 +__664: + pushl -3 + getf 0 + pushg 2 + eq + brt __663 +__665: + jmp __667 +__666: + pushl 0 + getf 1 + pushg 9 + getf 1 + putf 1 + pushg 9 + getf 2 + popg 9 + pushl 0 + getf 2 + popl 0 +__667: + pushl 0 + getf 0 + pushg 2 + eq + brt __666 +__668: +__660: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } quote(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_quote: + asf 0 + pushl -3 + getf 1 + popr + jmp __669 +__669: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } eval(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_eval: + asf 1 + pushl -3 + getf 0 + pushg 2 + ne + brf __671 + pushl -3 + getf 1 + popr + jmp __670 +__671: + pushl -3 + getf 1 + getf 0 + pushg 0 + eq + brf __672 + pushl -3 + getf 1 + getf 3 + pushg 10 + refeq + brf __673 + pushl -3 + getf 1 + pushl -3 + getf 1 + getf 1 + refeq + brf __674 + pushl -3 + call _evlis + drop 1 + pushr + popr + jmp __670 +__674: + pushl -3 + getf 1 + getf 1 + pushl -3 + getf 2 + call _makeNode + drop 2 + pushr + popl 0 + pushl 0 + call _eval + drop 1 + pushr + popr + jmp __670 +__673: + pushl -3 + getf 1 + getf 3 + getf 1 + pushg 12 + refeq + dup + brt __676 + drop 1 + pushl -3 + getf 1 + getf 3 + getf 1 + pushg 14 + refeq +__676: + brf __675 + pushl -3 + getf 2 + call _evlis + drop 1 + pushr + popl 0 + pushl -3 + getf 1 + pushl 0 + call _apply + drop 2 + pushr + popr + jmp __670 +__675: + pushl -3 + getf 1 + getf 3 + getf 1 + pushg 13 + refeq + dup + brt __678 + drop 1 + pushl -3 + getf 1 + getf 3 + getf 1 + pushg 15 + refeq +__678: + brf __677 + pushl -3 + getf 1 + pushl -3 + getf 2 + call _apply + drop 2 + pushr + popr + jmp __670 +__677: + pushl -3 + call _evlis + drop 1 + pushr + popr + jmp __670 +__672: + pushl -3 + getf 1 + getf 1 + pushg 14 + refeq + brf __679 + pushl -3 + getf 2 + call _evlis + drop 1 + pushr + popl 0 + pushl -3 + getf 1 + pushl 0 + call _apply + drop 2 + pushr + popr + jmp __670 +__679: + pushl -3 + getf 1 + getf 1 + pushg 15 + refeq + brf __680 + pushl -3 + getf 1 + pushl -3 + getf 2 + call _apply + drop 2 + pushr + popr + jmp __670 +__680: + pushl -3 + call _evlis + drop 1 + pushr + popr + jmp __670 +__670: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } apply(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_apply: + asf 1 + pushl -4 + getf 0 + pushg 0 + eq + brf __682 + pushl -4 + getf 3 + pushg 10 + refeq + brf __683 + pushl -4 + pushl -4 + getf 1 + refeq + brf __684 + pushg 10 + popr + jmp __681 +__684: + pushl -4 + getf 1 + pushl -3 + call _apply + drop 2 + pushr + popr + jmp __681 +__683: + pushl -4 + getf 3 + getf 1 + pushg 12 + refeq + brf __685 + pushl -3 + getf 0 + pushg 2 + ne + brf __686 + pushl -4 + getf 3 + getf 2 + getf 5 + pushg 10 + pushg 10 + pushg 10 + call _exec + drop 4 + pushr + popr + jmp __681 +__686: + pushl -3 + getf 2 + getf 0 + pushg 2 + ne + brf __687 + pushl -4 + getf 3 + getf 2 + getf 5 + pushl -3 + getf 1 + pushg 10 + pushg 10 + call _exec + drop 4 + pushr + popr + jmp __681 +__687: + pushl -3 + getf 2 + getf 2 + getf 0 + pushg 2 + ne + brf __688 + pushl -4 + getf 3 + getf 2 + getf 5 + pushl -3 + getf 1 + pushl -3 + getf 2 + getf 1 + pushg 10 + call _exec + drop 4 + pushr + popr + jmp __681 +__688: + pushl -4 + getf 3 + getf 2 + getf 5 + pushl -3 + getf 1 + pushl -3 + getf 2 + getf 1 + pushl -3 + getf 2 + getf 2 + getf 1 + call _exec + drop 4 + pushr + popr + jmp __681 +__685: + pushl -4 + getf 3 + getf 1 + pushg 13 + refeq + brf __689 + pushl -4 + getf 3 + getf 2 + getf 5 + pushl -3 + pushg 10 + pushg 10 + call _exec + drop 4 + pushr + popr + jmp __681 +__689: + pushl -4 + getf 3 + getf 1 + pushg 14 + refeq + dup + brt __691 + drop 1 + pushl -4 + getf 3 + getf 1 + pushg 15 + refeq +__691: + brf __690 + pushl -4 + getf 3 + getf 2 + getf 1 + pushl -3 + call _bind + drop 2 + pushg 10 + pushl -4 + getf 3 + getf 2 + getf 2 + call _evalbody + drop 2 + pushr + popl 0 + pushl -4 + getf 3 + getf 2 + getf 1 + call _unbind + drop 1 + pushl 0 + popr + jmp __681 +__690: + pushg 10 + popr + jmp __681 +__682: + pushl -4 + getf 1 + pushg 14 + refeq + dup + brt __693 + drop 1 + pushl -4 + getf 1 + pushg 15 + refeq +__693: + brf __692 + pushl -4 + getf 2 + getf 1 + pushl -3 + call _bind + drop 2 + pushg 10 + pushl -4 + getf 2 + getf 2 + call _evalbody + drop 2 + pushr + popl 0 + pushl -4 + getf 2 + getf 1 + call _unbind + drop 1 + pushl 0 + popr + jmp __681 +__692: + pushg 10 + popr + jmp __681 +__681: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } cond(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_cond: + asf 1 + jmp __696 +__695: + pushl -3 + getf 1 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl 0 + pushg 10 + refne + brf __698 + pushl 0 + pushl -3 + getf 1 + getf 2 + call _evalbody + drop 2 + pushr + popr + jmp __694 +__698: + pushl -3 + getf 2 + popl -3 +__696: + pushl -3 + getf 0 + pushg 2 + eq + brt __695 +__697: + pushg 10 + popr + jmp __694 +__694: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } loop(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_loop: + asf 2 + jmp __701 +__700: + pushl -3 + popl 0 + jmp __704 +__703: + pushl 0 + getf 1 + getf 0 + pushg 2 + ne + dup + brt __708 + drop 1 + pushl 0 + getf 1 + getf 1 + getf 0 + pushg 2 + ne +__708: + brf __706 + pushl 0 + getf 1 + call _eval + drop 1 + pushl 0 + getf 2 + popl 0 + jmp __707 +__706: + pushl 0 + getf 1 + getf 1 + getf 1 + getf 0 + pushg 2 + ne + brf __709 + pushl 0 + getf 1 + getf 1 + call _eval + drop 1 + pushr + popl 1 + pushl 1 + pushg 10 + refne + brf __711 + pushl 1 + pushl 0 + getf 1 + getf 2 + call _evalbody + drop 2 + pushr + popr + jmp __699 +__711: + pushl 0 + getf 2 + popl 0 + jmp __710 +__709: + pushg 10 + pushl 0 + getf 1 + call _evalbody + drop 2 + pushl 0 + getf 2 + popl 0 +__710: +__707: +__704: + pushl 0 + getf 0 + pushg 2 + eq + brt __703 +__705: +__701: + pushc 1 + brt __700 +__702: +__699: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } prog1(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_prog1: + asf 1 + pushl -3 + getf 1 + call _eval + drop 1 + pushr + popl 0 + pushl -3 + getf 2 + popl -3 + jmp __714 +__713: + pushl -3 + getf 1 + call _eval + drop 1 + pushl -3 + getf 2 + popl -3 +__714: + pushl -3 + getf 0 + pushg 2 + eq + brt __713 +__715: + pushl 0 + popr + jmp __712 +__712: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } driver() +// +_driver: + asf 2 + pushg 79 + pushg 10 + putf 1 + pushg 84 + pushg 10 + putf 1 + pushg 83 + pushg 10 + putf 1 + pushg 82 + pushg 82 + putf 1 + jmp __718 +__717: + pushc 10 + call _printChar + drop 1 + pushc 36 + call _printChar + drop 1 + pushc 10 + call _printChar + drop 1 + call _read + pushr + popl 0 + pushl 0 + call _eval + drop 1 + pushr + popl 1 + pushl 1 + call _print + drop 1 +__718: + pushc 1 + brt __717 +__719: + pushg 10 + popr + jmp __716 +__716: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } reclaim() +// +_reclaim: + asf 0 + pushc 23 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 67 + putfa + dup + pushc 3 + pushc 76 + putfa + dup + pushc 4 + pushc 65 + putfa + dup + pushc 5 + pushc 73 + putfa + dup + pushc 6 + pushc 77 + putfa + dup + pushc 7 + pushc 32 + putfa + dup + pushc 8 + pushc 110 + putfa + dup + pushc 9 + pushc 111 + putfa + dup + pushc 10 + pushc 116 + putfa + dup + pushc 11 + pushc 32 + putfa + dup + pushc 12 + pushc 105 + putfa + dup + pushc 13 + pushc 109 + putfa + dup + pushc 14 + pushc 112 + putfa + dup + pushc 15 + pushc 108 + putfa + dup + pushc 16 + pushc 101 + putfa + dup + pushc 17 + pushc 109 + putfa + dup + pushc 18 + pushc 101 + putfa + dup + pushc 19 + pushc 110 + putfa + dup + pushc 20 + pushc 116 + putfa + dup + pushc 21 + pushc 101 + putfa + dup + pushc 22 + pushc 100 + putfa + pushc 0 + call _error + drop 2 + pushg 10 + popr + jmp __720 +__720: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } save(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_save: + asf 0 + pushc 20 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 86 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 32 + putfa + dup + pushc 5 + pushc 110 + putfa + dup + pushc 6 + pushc 111 + putfa + dup + pushc 7 + pushc 116 + putfa + dup + pushc 8 + pushc 32 + putfa + dup + pushc 9 + pushc 105 + putfa + dup + pushc 10 + pushc 109 + putfa + dup + pushc 11 + pushc 112 + putfa + dup + pushc 12 + pushc 108 + putfa + dup + pushc 13 + pushc 101 + putfa + dup + pushc 14 + pushc 109 + putfa + dup + pushc 15 + pushc 101 + putfa + dup + pushc 16 + pushc 110 + putfa + dup + pushc 17 + pushc 116 + putfa + dup + pushc 18 + pushc 101 + putfa + dup + pushc 19 + pushc 100 + putfa + pushc 0 + call _error + drop 2 + pushg 10 + popr + jmp __721 +__721: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } load(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_load: + asf 0 + pushc 20 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 32 + putfa + dup + pushc 5 + pushc 110 + putfa + dup + pushc 6 + pushc 111 + putfa + dup + pushc 7 + pushc 116 + putfa + dup + pushc 8 + pushc 32 + putfa + dup + pushc 9 + pushc 105 + putfa + dup + pushc 10 + pushc 109 + putfa + dup + pushc 11 + pushc 112 + putfa + dup + pushc 12 + pushc 108 + putfa + dup + pushc 13 + pushc 101 + putfa + dup + pushc 14 + pushc 109 + putfa + dup + pushc 15 + pushc 101 + putfa + dup + pushc 16 + pushc 110 + putfa + dup + pushc 17 + pushc 116 + putfa + dup + pushc 18 + pushc 101 + putfa + dup + pushc 19 + pushc 100 + putfa + pushc 0 + call _error + drop 2 + pushg 10 + popr + jmp __722 +__722: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } system() +// +_system: + asf 0 + pushc 31 + newa + dup + pushc 0 + pushc 10 + putfa + dup + pushc 1 + pushc 84 + putfa + dup + pushc 2 + pushc 104 + putfa + dup + pushc 3 + pushc 97 + putfa + dup + pushc 4 + pushc 110 + putfa + dup + pushc 5 + pushc 107 + putfa + dup + pushc 6 + pushc 115 + putfa + dup + pushc 7 + pushc 32 + putfa + dup + pushc 8 + pushc 102 + putfa + dup + pushc 9 + pushc 111 + putfa + dup + pushc 10 + pushc 114 + putfa + dup + pushc 11 + pushc 32 + putfa + dup + pushc 12 + pushc 117 + putfa + dup + pushc 13 + pushc 115 + putfa + dup + pushc 14 + pushc 105 + putfa + dup + pushc 15 + pushc 110 + putfa + dup + pushc 16 + pushc 103 + putfa + dup + pushc 17 + pushc 32 + putfa + dup + pushc 18 + pushc 78 + putfa + dup + pushc 19 + pushc 105 + putfa + dup + pushc 20 + pushc 110 + putfa + dup + pushc 21 + pushc 106 + putfa + dup + pushc 22 + pushc 97 + putfa + dup + pushc 23 + pushc 32 + putfa + dup + pushc 24 + pushc 76 + putfa + dup + pushc 25 + pushc 73 + putfa + dup + pushc 26 + pushc 83 + putfa + dup + pushc 27 + pushc 80 + putfa + dup + pushc 28 + pushc 33 + putfa + dup + pushc 29 + pushc 10 + putfa + dup + pushc 30 + pushc 10 + putfa + call _writeString + drop 1 + call _exit + pushg 10 + popr + jmp __723 +__723: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } xchgpname(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }, record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_xchgpname: + asf 1 + pushl -4 + getf 0 + pushg 0 + ne + dup + brt __726 + drop 1 + pushl -3 + getf 0 + pushg 0 + ne +__726: + brf __725 + pushg 10 + popr + jmp __724 +__725: + pushl -4 + getf 4 + popl 0 + pushl -4 + pushl -3 + getf 4 + putf 4 + pushl -3 + pushl 0 + putf 4 + pushg 11 + popr + jmp __724 +__724: + rsf + ret + +// +// record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; } purgename(record { Integer typ; Cell car; Cell cdr; Cell func; String name; Integer val; }) +// +_purgename: + asf 1 + pushl -3 + getf 0 + pushg 0 + ne + brf __728 + pushg 10 + popr + jmp __727 +__728: + pushg 8 + popl 0 + pushl 0 + getf 0 + pushg 2 + eq + brf __729 + pushl 0 + getf 1 + pushl -3 + refeq + brf __730 + pushl 0 + getf 2 + popg 8 + pushg 11 + popr + jmp __727 +__730: + jmp __732 +__731: + pushl 0 + getf 2 + getf 1 + pushl -3 + refeq + brf __734 + pushl 0 + pushl 0 + getf 2 + getf 2 + putf 2 + pushg 11 + popr + jmp __727 +__734: + pushl 0 + getf 2 + popl 0 +__732: + pushl 0 + getf 2 + getf 0 + pushg 2 + eq + brt __731 +__733: +__729: + pushg 10 + popr + jmp __727 +__727: + rsf + ret + +// +// void initConstants() +// +_initConstants: + asf 0 + pushc 0 + popg 0 + pushc 1 + popg 1 + pushc 2 + popg 2 +__735: + rsf + ret + +// +// void initCharTypes() +// +_initCharTypes: + asf 1 + pushc 128 + newa + popg 3 + pushc 128 + newa + popg 4 + pushc 128 + newa + popg 5 + pushc 128 + newa + popg 6 + pushc 128 + newa + popg 7 + pushc 0 + popl 0 + jmp __738 +__737: + pushg 3 + pushl 0 + pushc 0 + putfa + pushg 4 + pushl 0 + pushc 0 + putfa + pushg 5 + pushl 0 + pushc 0 + putfa + pushg 6 + pushl 0 + pushc 0 + putfa + pushg 7 + pushl 0 + pushc 0 + putfa + pushl 0 + pushc 1 + add + popl 0 +__738: + pushl 0 + pushc 128 + lt + brt __737 +__739: + pushg 3 + pushc 32 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 3 + pushc 13 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 3 + pushc 10 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 3 + pushc 9 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 33 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 36 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 38 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 39 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 40 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 41 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 42 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 43 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 44 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 45 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 46 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 47 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 64 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 58 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 59 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 60 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 61 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 62 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 63 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 91 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 92 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 93 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 94 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 95 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 96 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 123 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 124 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 125 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 4 + pushc 126 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 5 + pushc 32 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 5 + pushc 44 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 5 + pushc 13 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 5 + pushc 10 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 5 + pushc 9 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 6 + pushc 40 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 6 + pushc 41 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 6 + pushc 46 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 6 + pushc 91 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 6 + pushc 93 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 7 + pushc 34 + call _char2int + drop 1 + pushr + pushc 1 + putfa + pushg 7 + pushc 37 + call _char2int + drop 1 + pushr + pushc 1 + putfa +__736: + rsf + ret + +// +// void initObjects() +// +_initObjects: + asf 0 + call _makeNil + pushr + popg 10 + pushg 10 + popg 8 + pushg 10 + call _addOblist + drop 1 + pushg 10 + popg 9 + pushc 1 + newa + dup + pushc 0 + pushc 84 + putfa + call _makeObject + drop 1 + pushr + popg 11 + pushc 4 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 66 + putfa + dup + pushc 3 + pushc 82 + putfa + call _makeObject + drop 1 + pushr + popg 12 + pushc 5 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 83 + putfa + dup + pushc 2 + pushc 85 + putfa + dup + pushc 3 + pushc 66 + putfa + dup + pushc 4 + pushc 82 + putfa + call _makeObject + drop 1 + pushr + popg 13 + pushc 6 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 66 + putfa + dup + pushc 4 + pushc 68 + putfa + dup + pushc 5 + pushc 65 + putfa + call _makeObject + drop 1 + pushr + popg 14 + pushc 7 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 76 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 77 + putfa + dup + pushc 4 + pushc 66 + putfa + dup + pushc 5 + pushc 68 + putfa + dup + pushc 6 + pushc 65 + putfa + call _makeObject + drop 1 + pushr + popg 15 + pushc 4 + newa + dup + pushc 0 + pushc 69 + putfa + dup + pushc 1 + pushc 67 + putfa + dup + pushc 2 + pushc 72 + putfa + dup + pushc 3 + pushc 79 + putfa + call _makeObject + drop 1 + pushr + popg 83 + pushc 4 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 12 + pushc 64 + call _makeBuiltin + drop 3 + pushr + popg 81 + pushc 5 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 84 + putfa + dup + pushc 3 + pushc 79 + putfa + dup + pushc 4 + pushc 77 + putfa + pushg 12 + pushc 63 + call _makeBuiltin + drop 3 + pushr + popg 80 + pushc 6 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 67 + putfa + dup + pushc 5 + pushc 72 + putfa + pushg 12 + pushc 65 + call _makeBuiltin + drop 3 + pushr + popg 82 + pushc 3 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 83 + putfa + pushg 12 + pushc 62 + call _makeBuiltin + drop 3 + pushr + popg 79 + pushc 5 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 73 + putfa + dup + pushc 3 + pushc 78 + putfa + dup + pushc 4 + pushc 84 + putfa + pushg 12 + pushc 67 + call _makeBuiltin + drop 3 + pushr + popg 85 + pushc 5 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 73 + putfa + dup + pushc 3 + pushc 78 + putfa + dup + pushc 4 + pushc 49 + putfa + pushg 12 + pushc 68 + call _makeBuiltin + drop 3 + pushr + popg 86 + pushc 3 + newa + dup + pushc 0 + pushc 87 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 83 + putfa + pushg 12 + pushc 66 + call _makeBuiltin + drop 3 + pushr + popg 84 + pushc 6 + newa + dup + pushc 0 + pushc 68 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 73 + putfa + dup + pushc 3 + pushc 86 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 82 + putfa + pushg 12 + pushc 79 + call _makeBuiltin + drop 3 + pushr + popg 97 + pushc 3 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 82 + putfa + pushg 12 + pushc 0 + call _makeBuiltin + drop 3 + pushr + popg 16 + pushc 3 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 82 + putfa + pushg 12 + pushc 1 + call _makeBuiltin + drop 3 + pushr + popg 17 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 82 + putfa + pushg 12 + pushc 3 + call _makeBuiltin + drop 3 + pushr + popg 19 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 82 + putfa + pushg 12 + pushc 5 + call _makeBuiltin + drop 3 + pushr + popg 21 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 9 + call _makeBuiltin + drop 3 + pushr + popg 25 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 13 + call _makeBuiltin + drop 3 + pushr + popg 29 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 82 + putfa + pushg 12 + pushc 2 + call _makeBuiltin + drop 3 + pushr + popg 18 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 82 + putfa + pushg 12 + pushc 4 + call _makeBuiltin + drop 3 + pushr + popg 20 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 6 + call _makeBuiltin + drop 3 + pushr + popg 22 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 10 + call _makeBuiltin + drop 3 + pushr + popg 26 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 8 + call _makeBuiltin + drop 3 + pushr + popg 24 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 12 + call _makeBuiltin + drop 3 + pushr + popg 28 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 7 + call _makeBuiltin + drop 3 + pushr + popg 23 + pushc 5 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 68 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + dup + pushc 4 + pushc 82 + putfa + pushg 12 + pushc 11 + call _makeBuiltin + drop 3 + pushr + popg 27 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 83 + putfa + pushg 12 + pushc 14 + call _makeBuiltin + drop 3 + pushr + popg 30 + pushc 6 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 80 + putfa + dup + pushc 2 + pushc 76 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 67 + putfa + dup + pushc 5 + pushc 65 + putfa + pushg 12 + pushc 18 + call _makeBuiltin + drop 3 + pushr + popg 34 + pushc 6 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 80 + putfa + dup + pushc 2 + pushc 76 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 67 + putfa + dup + pushc 5 + pushc 68 + putfa + pushg 12 + pushc 19 + call _makeBuiltin + drop 3 + pushr + popg 35 + pushc 5 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 67 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 78 + putfa + dup + pushc 4 + pushc 67 + putfa + pushg 12 + pushc 20 + call _makeBuiltin + drop 3 + pushr + popg 36 + pushc 3 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 84 + putfa + pushg 12 + pushc 38 + call _makeBuiltin + drop 3 + pushr + popg 55 + pushc 5 + newa + dup + pushc 0 + pushc 65 + putfa + dup + pushc 1 + pushc 83 + putfa + dup + pushc 2 + pushc 83 + putfa + dup + pushc 3 + pushc 79 + putfa + dup + pushc 4 + pushc 67 + putfa + pushg 12 + pushc 42 + call _makeBuiltin + drop 3 + pushr + popg 59 + pushc 3 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 84 + putfa + pushg 12 + pushc 44 + call _makeBuiltin + drop 3 + pushr + popg 61 + pushc 3 + newa + dup + pushc 0 + pushc 71 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 84 + putfa + pushg 12 + pushc 43 + call _makeBuiltin + drop 3 + pushr + popg 60 + pushc 6 + newa + dup + pushc 0 + pushc 77 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 66 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 82 + putfa + pushg 12 + pushc 31 + call _makeBuiltin + drop 3 + pushr + popg 47 + pushc 7 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 80 + putfa + dup + pushc 4 + pushc 82 + putfa + dup + pushc 5 + pushc 79 + putfa + dup + pushc 6 + pushc 80 + putfa + pushg 12 + pushc 45 + call _makeBuiltin + drop 3 + pushr + popg 62 + pushc 5 + newa + dup + pushc 0 + pushc 70 + putfa + dup + pushc 1 + pushc 76 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 71 + putfa + dup + pushc 4 + pushc 80 + putfa + pushg 12 + pushc 46 + call _makeBuiltin + drop 3 + pushr + popg 63 + pushc 4 + newa + dup + pushc 0 + pushc 70 + putfa + dup + pushc 1 + pushc 76 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 71 + putfa + pushg 12 + pushc 47 + call _makeBuiltin + drop 3 + pushr + popg 64 + pushc 7 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 70 + putfa + dup + pushc 4 + pushc 76 + putfa + dup + pushc 5 + pushc 65 + putfa + dup + pushc 6 + pushc 71 + putfa + pushg 12 + pushc 48 + call _makeBuiltin + drop 3 + pushr + popg 65 + pushc 4 + newa + dup + pushc 0 + pushc 77 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 86 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 12 + pushc 51 + call _makeBuiltin + drop 3 + pushr + popg 68 + pushc 4 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 84 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 12 + pushc 50 + call _makeBuiltin + drop 3 + pushr + popg 67 + pushc 4 + newa + dup + pushc 0 + pushc 71 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 84 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 12 + pushc 49 + call _makeBuiltin + drop 3 + pushr + popg 66 + pushc 4 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 67 + putfa + dup + pushc 3 + pushc 75 + putfa + pushg 12 + pushc 52 + call _makeBuiltin + drop 3 + pushr + popg 69 + pushc 6 + newa + dup + pushc 0 + pushc 85 + putfa + dup + pushc 1 + pushc 78 + putfa + dup + pushc 2 + pushc 80 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 67 + putfa + dup + pushc 5 + pushc 75 + putfa + pushg 12 + pushc 53 + call _makeBuiltin + drop 3 + pushr + popg 70 + pushc 6 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 71 + putfa + dup + pushc 4 + pushc 84 + putfa + dup + pushc 5 + pushc 72 + putfa + pushg 12 + pushc 54 + call _makeBuiltin + drop 3 + pushr + popg 71 + pushc 7 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 86 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 82 + putfa + dup + pushc 5 + pushc 83 + putfa + dup + pushc 6 + pushc 69 + putfa + pushg 12 + pushc 16 + call _makeBuiltin + drop 3 + pushr + popg 32 + pushc 6 + newa + dup + pushc 0 + pushc 79 + putfa + dup + pushc 1 + pushc 66 + putfa + dup + pushc 2 + pushc 76 + putfa + dup + pushc 3 + pushc 73 + putfa + dup + pushc 4 + pushc 83 + putfa + dup + pushc 5 + pushc 84 + putfa + pushg 12 + pushc 17 + call _makeBuiltin + drop 3 + pushr + popg 33 + pushc 4 + newa + dup + pushc 0 + pushc 65 + putfa + dup + pushc 1 + pushc 84 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 77 + putfa + pushg 12 + pushc 23 + call _makeBuiltin + drop 3 + pushr + popg 39 + pushc 4 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 69 + putfa + pushg 12 + pushc 21 + call _makeBuiltin + drop 3 + pushr + popg 37 + pushc 4 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 76 + putfa + dup + pushc 3 + pushc 76 + putfa + pushg 12 + pushc 24 + call _makeBuiltin + drop 3 + pushr + popg 40 + pushc 3 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 84 + putfa + pushg 12 + pushc 35 + call _makeBuiltin + drop 3 + pushr + popg 52 + pushc 6 + newa + dup + pushc 0 + pushc 79 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 82 + putfa + dup + pushc 5 + pushc 80 + putfa + pushg 12 + pushc 34 + call _makeBuiltin + drop 3 + pushr + popg 50 + pushc 7 + newa + dup + pushc 0 + pushc 79 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 82 + putfa + dup + pushc 5 + pushc 69 + putfa + dup + pushc 6 + pushc 68 + putfa + call _makeObject + drop 1 + pushr + popg 51 + pushc 2 + newa + dup + pushc 0 + pushc 69 + putfa + dup + pushc 1 + pushc 81 + putfa + pushg 12 + pushc 29 + call _makeBuiltin + drop 3 + pushr + popg 45 + pushc 5 + newa + dup + pushc 0 + pushc 69 + putfa + dup + pushc 1 + pushc 81 + putfa + dup + pushc 2 + pushc 85 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 76 + putfa + pushg 12 + pushc 30 + call _makeBuiltin + drop 3 + pushr + popg 46 + pushc 5 + newa + dup + pushc 0 + pushc 65 + putfa + dup + pushc 1 + pushc 80 + putfa + dup + pushc 2 + pushc 80 + putfa + dup + pushc 3 + pushc 76 + putfa + dup + pushc 4 + pushc 89 + putfa + pushg 12 + pushc 75 + call _makeBuiltin + drop 3 + pushr + popg 93 + pushc 4 + newa + dup + pushc 0 + pushc 69 + putfa + dup + pushc 1 + pushc 86 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 76 + putfa + pushg 12 + pushc 74 + call _makeBuiltin + drop 3 + pushr + popg 92 + pushc 7 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 67 + putfa + dup + pushc 3 + pushc 76 + putfa + dup + pushc 4 + pushc 65 + putfa + dup + pushc 5 + pushc 73 + putfa + dup + pushc 6 + pushc 77 + putfa + pushg 12 + pushc 80 + call _makeBuiltin + drop 3 + pushr + popg 98 + pushc 6 + newa + dup + pushc 0 + pushc 84 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 82 + putfa + dup + pushc 3 + pushc 80 + putfa + dup + pushc 4 + pushc 82 + putfa + dup + pushc 5 + pushc 73 + putfa + pushg 12 + pushc 69 + call _makeBuiltin + drop 3 + pushr + popg 87 + pushc 6 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 80 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 67 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 83 + putfa + pushg 12 + pushc 70 + call _makeBuiltin + drop 3 + pushr + popg 88 + pushc 10 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 76 + putfa + dup + pushc 5 + pushc 69 + putfa + dup + pushc 6 + pushc 78 + putfa + dup + pushc 7 + pushc 71 + putfa + dup + pushc 8 + pushc 84 + putfa + dup + pushc 9 + pushc 72 + putfa + pushg 12 + pushc 71 + call _makeBuiltin + drop 3 + pushr + popg 89 + pushc 5 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 68 + putfa + dup + pushc 3 + pushc 73 + putfa + dup + pushc 4 + pushc 88 + putfa + pushg 12 + pushc 72 + call _makeBuiltin + drop 3 + pushr + popg 90 + pushc 4 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 65 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 12 + pushc 82 + call _makeBuiltin + drop 3 + pushr + popg 100 + pushc 4 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 65 + putfa + dup + pushc 2 + pushc 86 + putfa + dup + pushc 3 + pushc 69 + putfa + pushg 12 + pushc 81 + call _makeBuiltin + drop 3 + pushr + popg 99 + pushc 6 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 89 + putfa + dup + pushc 2 + pushc 83 + putfa + dup + pushc 3 + pushc 84 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 77 + putfa + pushg 12 + pushc 83 + call _makeBuiltin + drop 3 + pushr + popg 101 + pushc 7 + newa + dup + pushc 0 + pushc 78 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 66 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 82 + putfa + dup + pushc 6 + pushc 80 + putfa + pushg 12 + pushc 22 + call _makeBuiltin + drop 3 + pushr + popg 38 + pushc 8 + newa + dup + pushc 0 + pushc 71 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 69 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 84 + putfa + dup + pushc 5 + pushc 69 + putfa + dup + pushc 6 + pushc 82 + putfa + dup + pushc 7 + pushc 80 + putfa + pushg 12 + pushc 32 + call _makeBuiltin + drop 3 + pushr + popg 48 + pushc 5 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 83 + putfa + dup + pushc 3 + pushc 83 + putfa + dup + pushc 4 + pushc 80 + putfa + pushg 12 + pushc 33 + call _makeBuiltin + drop 3 + pushr + popg 49 + pushc 5 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 76 + putfa + dup + pushc 2 + pushc 85 + putfa + dup + pushc 3 + pushc 83 + putfa + dup + pushc 4 + pushc 80 + putfa + pushg 12 + pushc 25 + call _makeBuiltin + drop 3 + pushr + popg 41 + pushc 6 + newa + dup + pushc 0 + pushc 77 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 85 + putfa + dup + pushc 4 + pushc 83 + putfa + dup + pushc 5 + pushc 80 + putfa + pushg 12 + pushc 26 + call _makeBuiltin + drop 3 + pushr + popg 42 + pushc 5 + newa + dup + pushc 0 + pushc 90 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 82 + putfa + dup + pushc 3 + pushc 79 + putfa + dup + pushc 4 + pushc 80 + putfa + pushg 12 + pushc 27 + call _makeBuiltin + drop 3 + pushr + popg 43 + pushc 4 + newa + dup + pushc 0 + pushc 69 + putfa + dup + pushc 1 + pushc 86 + putfa + dup + pushc 2 + pushc 69 + putfa + dup + pushc 3 + pushc 78 + putfa + pushg 12 + pushc 28 + call _makeBuiltin + drop 3 + pushr + popg 44 + pushc 5 + newa + dup + pushc 0 + pushc 77 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 85 + putfa + dup + pushc 4 + pushc 83 + putfa + pushg 12 + pushc 55 + call _makeBuiltin + drop 3 + pushr + popg 72 + pushc 4 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 76 + putfa + dup + pushc 2 + pushc 85 + putfa + dup + pushc 3 + pushc 83 + putfa + pushg 12 + pushc 56 + call _makeBuiltin + drop 3 + pushr + popg 73 + pushc 10 + newa + dup + pushc 0 + pushc 68 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 70 + putfa + dup + pushc 3 + pushc 70 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 82 + putfa + dup + pushc 6 + pushc 69 + putfa + dup + pushc 7 + pushc 78 + putfa + dup + pushc 8 + pushc 67 + putfa + dup + pushc 9 + pushc 69 + putfa + pushg 12 + pushc 57 + call _makeBuiltin + drop 3 + pushr + popg 74 + pushc 5 + newa + dup + pushc 0 + pushc 84 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 69 + putfa + dup + pushc 4 + pushc 83 + putfa + pushg 12 + pushc 58 + call _makeBuiltin + drop 3 + pushr + popg 75 + pushc 6 + newa + dup + pushc 0 + pushc 68 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 86 + putfa + dup + pushc 3 + pushc 73 + putfa + dup + pushc 4 + pushc 68 + putfa + dup + pushc 5 + pushc 69 + putfa + pushg 12 + pushc 61 + call _makeBuiltin + drop 3 + pushr + popg 78 + pushc 8 + newa + dup + pushc 0 + pushc 81 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 84 + putfa + dup + pushc 4 + pushc 73 + putfa + dup + pushc 5 + pushc 69 + putfa + dup + pushc 6 + pushc 78 + putfa + dup + pushc 7 + pushc 84 + putfa + pushg 12 + pushc 59 + call _makeBuiltin + drop 3 + pushr + popg 76 + pushc 9 + newa + dup + pushc 0 + pushc 82 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 77 + putfa + dup + pushc 3 + pushc 65 + putfa + dup + pushc 4 + pushc 73 + putfa + dup + pushc 5 + pushc 78 + putfa + dup + pushc 6 + pushc 68 + putfa + dup + pushc 7 + pushc 69 + putfa + dup + pushc 8 + pushc 82 + putfa + pushg 12 + pushc 60 + call _makeBuiltin + drop 3 + pushr + popg 77 + pushc 4 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 73 + putfa + dup + pushc 2 + pushc 83 + putfa + dup + pushc 3 + pushc 84 + putfa + pushg 13 + pushc 15 + call _makeBuiltin + drop 3 + pushr + popg 31 + pushc 5 + newa + dup + pushc 0 + pushc 81 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 84 + putfa + dup + pushc 4 + pushc 69 + putfa + pushg 13 + pushc 73 + call _makeBuiltin + drop 3 + pushr + popg 91 + pushc 4 + newa + dup + pushc 0 + pushc 67 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 78 + putfa + dup + pushc 3 + pushc 68 + putfa + pushg 13 + pushc 76 + call _makeBuiltin + drop 3 + pushr + popg 94 + pushc 4 + newa + dup + pushc 0 + pushc 76 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 80 + putfa + pushg 13 + pushc 77 + call _makeBuiltin + drop 3 + pushr + popg 95 + pushc 5 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 82 + putfa + dup + pushc 2 + pushc 79 + putfa + dup + pushc 3 + pushc 71 + putfa + dup + pushc 4 + pushc 49 + putfa + pushg 13 + pushc 78 + call _makeBuiltin + drop 3 + pushr + popg 96 + pushc 3 + newa + dup + pushc 0 + pushc 65 + putfa + dup + pushc 1 + pushc 78 + putfa + dup + pushc 2 + pushc 68 + putfa + pushg 13 + pushc 36 + call _makeBuiltin + drop 3 + pushr + popg 53 + pushc 2 + newa + dup + pushc 0 + pushc 79 + putfa + dup + pushc 1 + pushc 82 + putfa + pushg 13 + pushc 37 + call _makeBuiltin + drop 3 + pushr + popg 54 + pushc 4 + newa + dup + pushc 0 + pushc 83 + putfa + dup + pushc 1 + pushc 69 + putfa + dup + pushc 2 + pushc 84 + putfa + dup + pushc 3 + pushc 81 + putfa + pushg 13 + pushc 39 + call _makeBuiltin + drop 3 + pushr + popg 56 + pushc 3 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 79 + putfa + dup + pushc 2 + pushc 80 + putfa + pushg 13 + pushc 40 + call _makeBuiltin + drop 3 + pushr + popg 57 + pushc 4 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 83 + putfa + dup + pushc 3 + pushc 72 + putfa + pushg 13 + pushc 41 + call _makeBuiltin + drop 3 + pushr + popg 58 + pushc 9 + newa + dup + pushc 0 + pushc 88 + putfa + dup + pushc 1 + pushc 67 + putfa + dup + pushc 2 + pushc 72 + putfa + dup + pushc 3 + pushc 71 + putfa + dup + pushc 4 + pushc 80 + putfa + dup + pushc 5 + pushc 78 + putfa + dup + pushc 6 + pushc 65 + putfa + dup + pushc 7 + pushc 77 + putfa + dup + pushc 8 + pushc 69 + putfa + pushg 12 + pushc 84 + call _makeBuiltin + drop 3 + pushr + popg 102 + pushc 9 + newa + dup + pushc 0 + pushc 80 + putfa + dup + pushc 1 + pushc 85 + putfa + dup + pushc 2 + pushc 82 + putfa + dup + pushc 3 + pushc 71 + putfa + dup + pushc 4 + pushc 69 + putfa + dup + pushc 5 + pushc 78 + putfa + dup + pushc 6 + pushc 65 + putfa + dup + pushc 7 + pushc 77 + putfa + dup + pushc 8 + pushc 69 + putfa + pushg 12 + pushc 85 + call _makeBuiltin + drop 3 + pushr + popg 103 +__740: + rsf + ret + +// +// void initCtlVars() +// +_initCtlVars: + asf 0 + pushc 0 + popg 108 + pushg 79 + pushg 10 + putf 1 + pushg 81 + pushg 81 + putf 1 + pushg 82 + pushg 82 + putf 1 + pushg 83 + pushg 10 + putf 1 + pushg 84 + pushg 10 + putf 1 + pushg 85 + pushg 85 + putf 1 + pushg 86 + pushg 86 + putf 1 + pushc 0 + popg 104 + pushc 79 + popg 105 + pushc 10 + popg 106 +__741: + rsf + ret + +// +// void main() +// +_main: + asf 0 + pushc 24 + newa + dup + pushc 0 + pushc 10 + putfa + dup + pushc 1 + pushc 87 + putfa + dup + pushc 2 + pushc 101 + putfa + dup + pushc 3 + pushc 108 + putfa + dup + pushc 4 + pushc 99 + putfa + dup + pushc 5 + pushc 111 + putfa + dup + pushc 6 + pushc 109 + putfa + dup + pushc 7 + pushc 101 + putfa + dup + pushc 8 + pushc 32 + putfa + dup + pushc 9 + pushc 116 + putfa + dup + pushc 10 + pushc 111 + putfa + dup + pushc 11 + pushc 32 + putfa + dup + pushc 12 + pushc 78 + putfa + dup + pushc 13 + pushc 105 + putfa + dup + pushc 14 + pushc 110 + putfa + dup + pushc 15 + pushc 106 + putfa + dup + pushc 16 + pushc 97 + putfa + dup + pushc 17 + pushc 32 + putfa + dup + pushc 18 + pushc 76 + putfa + dup + pushc 19 + pushc 73 + putfa + dup + pushc 20 + pushc 83 + putfa + dup + pushc 21 + pushc 80 + putfa + dup + pushc 22 + pushc 33 + putfa + dup + pushc 23 + pushc 10 + putfa + call _writeString + drop 1 + call _initConstants + call _initCharTypes + call _initObjects + call _initCtlVars + jmp __744 +__743: + pushg 97 + pushg 10 + call _apply + drop 2 +__744: + pushc 1 + brt __743 +__745: +__742: + rsf + ret diff --git a/njlisp.bin b/njlisp.bin new file mode 100644 index 0000000..bdf9d64 Binary files /dev/null and b/njlisp.bin differ diff --git a/njlisp.nj b/njlisp.nj new file mode 100644 index 0000000..1a7ab3e --- /dev/null +++ b/njlisp.nj @@ -0,0 +1,2580 @@ +// ------------------------------------------------------------- +// +// njlisp.nj -- Ninja LISP +// +// This is a re-implementation of the old muLISP-80 system, +// developed in 1980 by Albert D. Rich and David Stoutemyer +// of The Soft Warehouse in Honolulu, Hawaii. +// +// ------------------------------------------------------------- + +// ------------------------------------------------------------- +// Cell Definition +// ------------------------------------------------------------- + +type Cell = record { + Integer typ; // one of NAME, NUMBER, or NODE + Cell car; // valid for typ in { NAME, NUMBER, NODE } + // typ = NAME : the name's value + // typ = NUMBER : the number itself + // typ = NODE : the node's left subtree + Cell cdr; // valid for typ in { NAME, NUMBER, NODE } + // typ = NAME : the name's property list + // typ = NUMBER : the number's sign + // typ = NODE : the node's right subtree + Cell func; // valid only for typ = NAME + // the name's functional binding + String name; // valid only for typ = NAME + // the name's external representation + Integer val; // valid only for typ = NUMBER + // the number's value (signed integer) +}; + +// ------------------------------------------------------------- +// Global Constants +// ------------------------------------------------------------- + +global Integer NAME; // name cell +global Integer NUMBER; // number cell +global Integer NODE; // node cell + +global Boolean[] RAS; // ratom separator character +global Boolean[] RAB; // ratom break character +global Boolean[] RES; // read separator character +global Boolean[] REB; // read break character +global Boolean[] OSP; // other special character (% and ") + +// ------------------------------------------------------------- +// Global Variables +// ------------------------------------------------------------- + +global Cell objectList; +global Cell argStack; + +global Cell nilAtom; +global Cell tAtom; +global Cell subrAtom; +global Cell nsubrAtom; +global Cell lambdaAtom; +global Cell nlambdaAtom; +global Cell carAtom; +global Cell cdrAtom; +global Cell caarAtom; +global Cell cadrAtom; +global Cell cdarAtom; +global Cell cddrAtom; +global Cell caaarAtom; +global Cell caadrAtom; +global Cell cadarAtom; +global Cell caddrAtom; +global Cell cdaarAtom; +global Cell cdadrAtom; +global Cell cddarAtom; +global Cell cdddrAtom; +global Cell consAtom; +global Cell listAtom; +global Cell reverseAtom; +global Cell oblistAtom; +global Cell rplacaAtom; +global Cell rplacdAtom; +global Cell nconcAtom; +global Cell nameAtom; +global Cell numberpAtom; +global Cell atomAtom; +global Cell nullAtom; +global Cell pluspAtom; +global Cell minuspAtom; +global Cell zeropAtom; +global Cell evenAtom; +global Cell eqAtom; +global Cell equalAtom; +global Cell memberAtom; +global Cell greaterpAtom; +global Cell lesspAtom; +global Cell orderpAtom; +global Cell orderedAtom; +global Cell notAtom; +global Cell andAtom; +global Cell orAtom; +global Cell setAtom; +global Cell setqAtom; +global Cell popAtom; +global Cell pushAtom; +global Cell assocAtom; +global Cell getAtom; +global Cell putAtom; +global Cell rempropAtom; +global Cell flagpAtom; +global Cell flagAtom; +global Cell remflagAtom; +global Cell getdAtom; +global Cell putdAtom; +global Cell movdAtom; +global Cell packAtom; +global Cell unpackAtom; +global Cell lengthAtom; +global Cell minusAtom; +global Cell plusAtom; +global Cell differenceAtom; +global Cell timesAtom; +global Cell quotientAtom; +global Cell remainderAtom; +global Cell divideAtom; +global Cell rdsAtom; +global Cell ratomAtom; +global Cell readAtom; +global Cell readchAtom; +global Cell echoAtom; +global Cell wrsAtom; +global Cell printAtom; +global Cell prin1Atom; +global Cell terpriAtom; +global Cell spacesAtom; +global Cell linelengthAtom; +global Cell radixAtom; +global Cell quoteAtom; +global Cell evalAtom; +global Cell applyAtom; +global Cell condAtom; +global Cell loopAtom; +global Cell prog1Atom; +global Cell driverAtom; +global Cell reclaimAtom; +global Cell saveAtom; +global Cell loadAtom; +global Cell systemAtom; +global Cell xchgpnameAtom; +global Cell purgenameAtom; + +global Integer cursPos; +global Integer lineLen; +global Integer numBase; + +// ------------------------------------------------------------- +// Debugging +// ------------------------------------------------------------- + +void debug(Integer n) { + writeString("DEBUG: "); + writeInteger(n); + writeString("\n"); +} + +// ------------------------------------------------------------- +// Library Functions +// ------------------------------------------------------------- + +Boolean isAlpha(Character ch) { + return ch >= 'A' && ch <= 'Z' || + ch >= 'a' && ch <= 'z'; +} + +Boolean isDigit(Character ch) { + return ch >= '0' && ch <= '9'; +} + +Character toLower(Character ch) { + if (ch >= 'A' && ch <= 'Z') { + ch = int2char(char2int(ch) + 0x20); + } + return ch; +} + +Character toUpper(Character ch) { + if (ch >= 'a' && ch <= 'z') { + ch = int2char(char2int(ch) - 0x20); + } + return ch; +} + +String toString(Character ch) { + local String str; + str = new(Character[1]); + str[0] = ch; + return str; +} + +Integer stringCompare(String s1, String s2) { + local Integer n1; + local Integer n2; + local Integer i; + n1 = sizeof(s1); + n2 = sizeof(s2); + i = 0; + while (i < n1 && i < n2) { + if (s1[i] != s2[i]) { + return char2int(s1[i]) - char2int(s2[i]); + } + i = i + 1; + } + return n1 - n2; +} + +type StringBuffer = record { + String str; + Integer len; +}; + +StringBuffer newStringBuffer(Integer size) { + local StringBuffer strBuf; + strBuf = new(StringBuffer); + strBuf.str = new(Character[size]); + strBuf.len = 0; + return strBuf; +} + +void addCharToStringBuffer(StringBuffer strBuf, Character ch) { + local String newStr; + local Integer i; + if (strBuf.len + 1 > sizeof(strBuf.str)) { + newStr = new(Character[2 * sizeof(strBuf.str)]); + i = 0; + while (i < strBuf.len) { + newStr[i] = strBuf.str[i]; + i = i + 1; + } + strBuf.str = newStr; + } + strBuf.str[strBuf.len] = ch; + strBuf.len = strBuf.len + 1; +} + +void addStringToStringBuffer(StringBuffer strBuf, String str) { + local Integer n; + local Integer i; + n = sizeof(str); + i = 0; + while (i < n) { + addCharToStringBuffer(strBuf, str[i]); + i = i + 1; + } +} + +String stringBufferToString(StringBuffer strBuf) { + local String str; + local Integer i; + str = new(Character[strBuf.len]); + i = 0; + while (i < strBuf.len) { + str[i] = strBuf.str[i]; + i = i + 1; + } + return str; +} + +// ------------------------------------------------------------- +// Auxiliary Functions +// ------------------------------------------------------------- + +void error(String message, Boolean fatal) { + writeString("\n"); + writeString(message); + writeString("\n\n"); + if (fatal) { + exit(); + } +} + +Cell makeNil() { + local Cell aux; + aux = new(Cell); + aux.typ = NAME; // NAME + aux.car = aux; // auto-quoting + aux.cdr = aux; // empty property list + aux.func = aux; // no functional binding + aux.name = "NIL"; // name is NIL + return aux; +} + +Cell makeName(String name) { + local Cell aux; + aux = new(Cell); + aux.typ = NAME; // NAME + aux.car = aux; // auto-quoting + aux.cdr = nilAtom; // empty property list + aux.func = nilAtom; // no functional binding + aux.name = name; // name as given in parameter + return aux; +} + +Cell makeNumber(Integer n) { + local Cell aux; + aux = new(Cell); + aux.typ = NUMBER; // NUMBER + aux.car = aux; // auto-quoting + if (n < 0) { + aux.cdr = tAtom; // number is negative + } else { + aux.cdr = nilAtom; // number is non-negative + } + aux.val = n; // value as given in parameter + return aux; +} + +Cell makeNode(Cell x, Cell y) { + local Cell aux; + aux = new(Cell); + aux.typ = NODE; // NODE + aux.car = x; // car as given in parameter + aux.cdr = y; // cdr as given in parameter + return aux; +} + +void addOblist(Cell x) { + objectList = makeNode(x, objectList); +} + +Cell makeObject(String name) { + local Cell aux; + aux = makeName(name); + addOblist(aux); + return aux; +} + +Cell makeBuiltin(String name, Cell kind, Integer n) { + local Cell aux; + aux = makeObject(name); + aux.func = makeNode(kind, makeNumber(n)); + return aux; +} + +Cell searchOblist(String name) { + local Cell aux; + aux = objectList; + while (aux.typ == NODE) { + if (stringCompare(aux.car.name, name) == 0) { + return aux.car; + } + aux = aux.cdr; + } + return makeObject(name); +} + +Cell copyTree(Cell x) { + local Cell anchor; + local Cell aux; + anchor = makeNode(nilAtom, nilAtom); + anchor.car = anchor; + while (x.typ == NODE) { + aux = copyTree(x.car); + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + x = x.cdr; + } + anchor.car.cdr = x; + return anchor.cdr; +} + +Cell execErr(Integer funcNum) { + writeString("exec: function "); + writeInteger(funcNum); + writeString(" not implemented\n"); + exit(); + // never reached + return nilAtom; +} + +Cell exec(Integer n, Cell x, Cell y, Cell z) { + if (n < 0 || n >= 128) { + error("Internal Exec Error", false); + return nilAtom; + } + if (n < 64) { + if (n < 32) { + if (n < 16) { + if (n < 8) { + if (n < 4) { + if (n < 2) { + if (n < 1) { + // n = 0 + return car(x); + } else { + // n = 1 + return cdr(x); + } + } else { + if (n < 3) { + // n = 2 + return caar(x); + } else { + // n = 3 + return cadr(x); + } + } + } else { + if (n < 6) { + if (n < 5) { + // n = 4 + return cdar(x); + } else { + // n = 5 + return cddr(x); + } + } else { + if (n < 7) { + // n = 6 + return caaar(x); + } else { + // n = 7 + return caadr(x); + } + } + } + } else { + if (n < 12) { + if (n < 10) { + if (n < 9) { + // n = 8 + return cadar(x); + } else { + // n = 9 + return caddr(x); + } + } else { + if (n < 11) { + // n = 10 + return cdaar(x); + } else { + // n = 11 + return cdadr(x); + } + } + } else { + if (n < 14) { + if (n < 13) { + // n = 12 + return cddar(x); + } else { + // n = 13 + return cdddr(x); + } + } else { + if (n < 15) { + // n = 14 + return cons(x, y); + } else { + // n = 15 + return list(x); + } + } + } + } + } else { + if (n < 24) { + if (n < 20) { + if (n < 18) { + if (n < 17) { + // n = 16 + return reverse(x, y); + } else { + // n = 17 + return oblist(); + } + } else { + if (n < 19) { + // n = 18 + return rplaca(x, y); + } else { + // n = 19 + return rplacd(x, y); + } + } + } else { + if (n < 22) { + if (n < 21) { + // n = 20 + return nconc(x, y); + } else { + // n = 21 + return name(x); + } + } else { + if (n < 23) { + // n = 22 + return numberp(x); + } else { + // n = 23 + return atom(x); + } + } + } + } else { + if (n < 28) { + if (n < 26) { + if (n < 25) { + // n = 24 + return null(x); + } else { + // n = 25 + return plusp(x); + } + } else { + if (n < 27) { + // n = 26 + return minusp(x); + } else { + // n = 27 + return zerop(x); + } + } + } else { + if (n < 30) { + if (n < 29) { + // n = 28 + return even(x); + } else { + // n = 29 + return eq(x, y); + } + } else { + if (n < 31) { + // n = 30 + return equal(x, y); + } else { + // n = 31 + return member(x, y); + } + } + } + } + } + } else { + if (n < 48) { + if (n < 40) { + if (n < 36) { + if (n < 34) { + if (n < 33) { + // n = 32 + return greaterp(x, y); + } else { + // n = 33 + return lessp(x, y); + } + } else { + if (n < 35) { + // n = 34 + return orderp(x, y); + } else { + // n = 35 + return not(x); + } + } + } else { + if (n < 38) { + if (n < 37) { + // n = 36 + return and(x); + } else { + // n = 37 + return or(x); + } + } else { + if (n < 39) { + // n = 38 + return set(x, y); + } else { + // n = 39 + return setq(x); + } + } + } + } else { + if (n < 44) { + if (n < 42) { + if (n < 41) { + // n = 40 + return pop(x); + } else { + // n = 41 + return push(x); + } + } else { + if (n < 43) { + // n = 42 + return assoc(x, y); + } else { + // n = 43 + return get(x, y); + } + } + } else { + if (n < 46) { + if (n < 45) { + // n = 44 + return put(x, y, z); + } else { + // n = 45 + return remprop(x, y); + } + } else { + if (n < 47) { + // n = 46 + return flagp(x, y); + } else { + // n = 47 + return flag(x, y); + } + } + } + } + } else { + if (n < 56) { + if (n < 52) { + if (n < 50) { + if (n < 49) { + // n = 48 + return remflag(x, y); + } else { + // n = 49 + return getd(x); + } + } else { + if (n < 51) { + // n = 50 + return putd(x, y); + } else { + // n = 51 + return movd(x, y); + } + } + } else { + if (n < 54) { + if (n < 53) { + // n = 52 + return pack(x); + } else { + // n = 53 + return unpack(x); + } + } else { + if (n < 55) { + // n = 54 + return length(x); + } else { + // n = 55 + return minus(x); + } + } + } + } else { + if (n < 60) { + if (n < 58) { + if (n < 57) { + // n = 56 + return plus(x, y); + } else { + // n = 57 + return difference(x, y); + } + } else { + if (n < 59) { + // n = 58 + return times(x, y); + } else { + // n = 59 + return quotient(x, y); + } + } + } else { + if (n < 62) { + if (n < 61) { + // n = 60 + return remainder(x, y); + } else { + // n = 61 + return divide(x, y); + } + } else { + if (n < 63) { + // n = 62 + return rds(x, y, z); + } else { + // n = 63 + return ratom(); + } + } + } + } + } + } + } else { + if (n < 96) { + if (n < 80) { + if (n < 72) { + if (n < 68) { + if (n < 66) { + if (n < 65) { + // n = 64 + return read(); + } else { + // n = 65 + return readch(); + } + } else { + if (n < 67) { + // n = 66 + return wrs(x, y, z); + } else { + // n = 67 + return print(x); + } + } + } else { + if (n < 70) { + if (n < 69) { + // n = 68 + return prin1(x); + } else { + // n = 69 + return terpri(x); + } + } else { + if (n < 71) { + // n = 70 + return spaces(x); + } else { + // n = 71 + return linelength(x); + } + } + } + } else { + if (n < 76) { + if (n < 74) { + if (n < 73) { + // n = 72 + return radix(x); + } else { + // n = 73 + return quote(x); + } + } else { + if (n < 75) { + // n = 74 + return eval(x); + } else { + // n = 75 + return apply(x, y); + } + } + } else { + if (n < 78) { + if (n < 77) { + // n = 76 + return cond(x); + } else { + // n = 77 + return loop(x); + } + } else { + if (n < 79) { + // n = 78 + return prog1(x); + } else { + // n = 79 + return driver(); + } + } + } + } + } else { + if (n < 88) { + if (n < 84) { + if (n < 82) { + if (n < 81) { + // n = 80 + return reclaim(); + } else { + // n = 81 + return save(x, y); + } + } else { + if (n < 83) { + // n = 82 + return load(x, y); + } else { + // n = 83 + return system(); + } + } + } else { + if (n < 86) { + if (n < 85) { + // n = 84 + return xchgpname(x, y); + } else { + // n = 85 + return purgename(x); + } + } else { + if (n < 87) { + // n = 86 + return execErr(86); + } else { + // n = 87 + return execErr(87); + } + } + } + } else { + if (n < 92) { + if (n < 90) { + if (n < 89) { + // n = 88 + return execErr(88); + } else { + // n = 89 + return execErr(89); + } + } else { + if (n < 91) { + // n = 90 + return execErr(90); + } else { + // n = 91 + return execErr(91); + } + } + } else { + if (n < 94) { + if (n < 93) { + // n = 92 + return execErr(92); + } else { + // n = 93 + return execErr(93); + } + } else { + if (n < 95) { + // n = 94 + return execErr(94); + } else { + // n = 95 + return execErr(95); + } + } + } + } + } + } else { + // n = 96..127 + execErr(n); + } + } +} + +// ------------------------------------------------------------- +// A. Selector Functions +// ------------------------------------------------------------- + +Cell car(Cell x) { + return x.car; +} + +Cell cdr(Cell x) { + return x.cdr; +} + +Cell caar(Cell x) { + return x.car.car; +} + +Cell cadr(Cell x) { + return x.cdr.car; +} + +Cell cdar(Cell x) { + return x.car.cdr; +} + +Cell cddr(Cell x) { + return x.cdr.cdr; +} + +Cell caaar(Cell x) { + return x.car.car.car; +} + +Cell caadr(Cell x) { + return x.cdr.car.car; +} + +Cell cadar(Cell x) { + return x.car.cdr.car; +} + +Cell caddr(Cell x) { + return x.cdr.cdr.car; +} + +Cell cdaar(Cell x) { + return x.car.car.cdr; +} + +Cell cdadr(Cell x) { + return x.cdr.car.cdr; +} + +Cell cddar(Cell x) { + return x.car.cdr.cdr; +} + +Cell cdddr(Cell x) { + return x.cdr.cdr.cdr; +} + +// ------------------------------------------------------------- +// B. Constructor Functions +// ------------------------------------------------------------- + +Cell cons(Cell x, Cell y) { + return makeNode(x, y); +} + +Cell list(Cell x) { + // ATTENTION: CBN + local Cell anchor; + local Cell aux; + anchor = makeNode(nilAtom, nilAtom); + anchor.car = anchor; + while (x.typ == NODE) { + aux = eval(x.car); + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + x = x.cdr; + } + anchor.car.cdr = x; + return anchor.cdr; +} + +Cell reverse(Cell x, Cell y) { + local Cell aux; + aux = y; + while (x.typ == NODE) { + aux = makeNode(x.car, aux); + x = x.cdr; + } + return aux; +} + +Cell oblist() { + return copyTree(objectList); +} + +// ------------------------------------------------------------- +// C. Modifier Functions +// ------------------------------------------------------------- + +Cell rplaca(Cell x, Cell y) { + x.car = y; + return x; +} + +Cell rplacd(Cell x, Cell y) { + x.cdr = y; + return x; +} + +Cell nconc(Cell x, Cell y) { + local Cell t; + if (x.typ != NODE) { + return y; + } + t = x; + while (t.cdr.typ == NODE) { + t = t.cdr; + } + t.cdr = y; + return x; +} + +// ------------------------------------------------------------- +// D. Recognizer Functions +// ------------------------------------------------------------- + +Cell name(Cell x) { + if (x.typ == NAME) { + return tAtom; + } + return nilAtom; +} + +Cell numberp(Cell x) { + if (x.typ == NUMBER) { + return tAtom; + } + return nilAtom; +} + +Cell atom(Cell x) { + if (x.typ != NODE) { + return tAtom; + } + return nilAtom; +} + +Cell null(Cell x) { + if (x == nilAtom) { + return tAtom; + } + return nilAtom; +} + +Cell plusp(Cell x) { + if (x.typ == NUMBER && x.val > 0) { + return tAtom; + } + return nilAtom; +} + +Cell minusp(Cell x) { + if (x.typ == NUMBER && x.val < 0) { + return tAtom; + } + return nilAtom; +} + +Cell zerop(Cell x) { + if (x.typ == NUMBER && x.val == 0) { + return tAtom; + } + return nilAtom; +} + +Cell even(Cell x) { + if (x.typ == NUMBER && x.val % 2 == 0) { + return tAtom; + } + return nilAtom; +} + +// ------------------------------------------------------------- +// E. Comparator Functions +// ------------------------------------------------------------- + +Cell eq(Cell x, Cell y) { + if (x == y) { + return tAtom; + } + if (x.typ == NUMBER && y.typ == NUMBER && x.val == y.val) { + return tAtom; + } + return nilAtom; +} + +Cell equal(Cell x, Cell y) { + while (x.typ == NODE && y.typ == NODE) { + if (equal(x.car, y.car) == nilAtom) { + return nilAtom; + } + x = x.cdr; + y = y.cdr; + } + return eq(x, y); +} + +Cell member(Cell x, Cell y) { + while (y.typ == NODE) { + if (equal(x, y.car) == tAtom) { + return tAtom; + } + y = y.cdr; + } + return y; +} + +Cell greaterp(Cell x, Cell y) { + if (x.typ == NUMBER && y.typ == NUMBER && x.val > y.val) { + return tAtom; + } + return nilAtom; +} + +Cell lessp(Cell x, Cell y) { + if (x.typ == NUMBER && y.typ == NUMBER && x.val < y.val) { + return tAtom; + } + return nilAtom; +} + +Cell orderp(Cell x, Cell y) { + local Cell aux; + if (x.typ == NODE) { + return nilAtom; + } + if (y.typ == NODE) { + return tAtom; + } + if (x.typ == NUMBER && y.typ == NUMBER) { + if (x.val < y.val) { + return tAtom; + } + return nilAtom; + } + if (x.typ == NUMBER) { + return tAtom; + } + if (y.typ == NUMBER) { + return nilAtom; + } + // both x and y are names + aux = objectList; + while (aux.typ == NODE) { + if (aux.car == x) { + return nilAtom; + } + if (aux.car == y) { + return tAtom; + } + aux = aux.cdr; + } + // this should never be reached + return nilAtom; +} + +// ------------------------------------------------------------- +// F. Logical Functions +// ------------------------------------------------------------- + +Cell not(Cell x) { + if (x == nilAtom) { + return tAtom; + } + return nilAtom; +} + +Cell and(Cell x) { + // ATTENTION: CBN + while (x.typ == NODE) { + if (eval(x.car) == nilAtom) { + return nilAtom; + } + x = x.cdr; + } + return tAtom; +} + +Cell or(Cell x) { + // ATTENTION: CBN + while (x.typ == NODE) { + if (eval(x.car) != nilAtom) { + return tAtom; + } + x = x.cdr; + } + return nilAtom; +} + +// ------------------------------------------------------------- +// G. Assignment Functions +// ------------------------------------------------------------- + +Cell set(Cell x, Cell y) { + x.car = y; + return y; +} + +Cell setq(Cell x) { + // ATTENTION: CBN + local Cell aux; + aux = eval(x.cdr.car); + x.car.car = aux; + return aux; +} + +Cell pop(Cell x) { + // ATTENTION: CBN + local Cell aux; + aux = eval(x.car); + x.car.car = aux.cdr; + return aux.car; +} + +Cell push(Cell x) { + // ATTENTION: CBN + local Cell aux1; + local Cell aux2; + local Cell aux3; + aux1 = eval(x.car); + aux2 = eval(x.cdr.car); + aux3 = makeNode(aux1, aux2); + x.cdr.car.car = aux3; + return aux3; +} + +// ------------------------------------------------------------- +// H. Property Functions +// ------------------------------------------------------------- + +Cell assoc(Cell x, Cell y) { + while (y.typ == NODE) { + if (y.car.typ == NODE && equal(y.car.car, x) == tAtom) { + return y.car; + } + y = y.cdr; + } + return y; +} + +Cell get(Cell x, Cell y) { + local Cell aux; + aux = assoc(y, x.cdr); + if (aux.typ != NODE) { + return nilAtom; + } + return aux.cdr; +} + +Cell put(Cell x, Cell y, Cell z) { + local Cell aux; + aux = assoc(y, x.cdr); + if (aux.typ != NODE) { + aux = makeNode(y, z); + x.cdr = makeNode(aux, x.cdr); + return z; + } + aux.cdr = z; + return z; +} + +Cell remprop(Cell x, Cell y) { + while (x.cdr.typ == NODE) { + if (equal(x.cdr.car.car, y) == tAtom) { + y = x.cdr.car.cdr; + x.cdr = x.cdr.cdr; + return y; + } + x = x.cdr; + } + return x.cdr; +} + +// ------------------------------------------------------------- +// I. Flag Functions +// ------------------------------------------------------------- + +Cell flagp(Cell x, Cell y) { + return member(y, x.cdr); +} + +Cell flag(Cell x, Cell y) { + if (member(y, x.cdr) == tAtom) { + return y; + } + x.cdr = makeNode(y, x.cdr); + return y; +} + +Cell remflag(Cell x, Cell y) { + while (x.cdr.typ == NODE) { + if (equal(y, x.cdr.car) == tAtom) { + x.cdr = x.cdr.cdr; + return y; + } + x = x.cdr; + } + return nilAtom; +} + +// ------------------------------------------------------------- +// J. Definition Functions +// ------------------------------------------------------------- + +Cell getd(Cell x) { + if (x.typ != NAME) { + return nilAtom; + } + return copyTree(x.func); +} + +Cell putd(Cell x, Cell y) { + if (x.typ != NAME) { + return nilAtom; + } + x.func = copyTree(y); + return y; +} + +Cell movd(Cell x, Cell y) { + if (x.typ != NAME || y.typ != NAME) { + return nilAtom; + } + y.func = x.func; + return copyTree(y.func); +} + +// ------------------------------------------------------------- +// K. Sub-atomic Functions +// ------------------------------------------------------------- + +// +// auxiliary stuff +// + +void addNumberToStringBuffer(StringBuffer strBuf, Integer n) { + local Integer a; + local Integer b; + if (n < 0) { + addCharToStringBuffer(strBuf, '-'); + n = -n; + } + a = n / numBase; + if (a != 0) { + addNumberToStringBuffer(strBuf, a); + } + b = n % numBase; + if (b < 10) { + addCharToStringBuffer(strBuf, int2char(char2int('0') + b)); + } else { + if (a == 0) { + // this is the first digit printed, and it is >= 10 + // prepend a single zero to distinguish number from name + addCharToStringBuffer(strBuf, '0'); + } + addCharToStringBuffer(strBuf, int2char(char2int('A') + (b - 10))); + } +} + +Integer countName(String s) { + local Integer k; + local Integer n; + local Integer i; + local Character ch; + local Boolean quoted; + k = 0; + n = sizeof(s); + i = 0; + quoted = false; + while (i < n) { + ch = s[i]; + if (prin1Atom.car == nilAtom && isSpecial(ch) && !quoted) { + quoted = true; + k = k + 1; + } + k = k + 1; + if (ch == '\"' && quoted) { + k = k + 1; + } + i = i + 1; + } + if (quoted) { + k = k + 1; + } + return k; +} + +Integer countNumber(Integer n) { + local Integer k; + local Integer a; + local Integer b; + k = 0; + if (n < 0) { + k = k + 1; + n = -n; + } + a = n / numBase; + if (a != 0) { + k = k + countNumber(a); + } + b = n % numBase; + if (a == 0 && b >= 10) { + // leading zero, see printNumber() + k = k + 1; + } + k = k + 1; + return k; +} + +// +// end of auxiliary stuff +// + +Cell pack(Cell x) { + local StringBuffer strBuf; + local String str; + strBuf = newStringBuffer(20); + while (x.typ == NODE) { + if (x.car.typ == NAME) { + addStringToStringBuffer(strBuf, x.car.name); + } else + if (x.car.typ == NUMBER) { + addNumberToStringBuffer(strBuf, x.car.val); + } + x = x.cdr; + } + str = stringBufferToString(strBuf); + return searchOblist(str); +} + +Cell unpack(Cell x) { + local StringBuffer strBuf; + local String str; + local Integer i; + local Cell anchor; + local Cell aux; + strBuf = newStringBuffer(20); + if (x.typ == NAME) { + addStringToStringBuffer(strBuf, x.name); + } else + if (x.typ == NUMBER) { + addNumberToStringBuffer(strBuf, x.val); + } else { + return nilAtom; + } + str = stringBufferToString(strBuf); + anchor = makeNode(nilAtom, nilAtom); + anchor.car = anchor; + i = 0; + while (i < sizeof(str)) { + aux = searchOblist(toString(str[i])); + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + i = i + 1; + } + return anchor.cdr; +} + +Cell length(Cell x) { + local Integer n; + if (x.typ == NAME) { + return makeNumber(countName(x.name)); + } + if (x.typ == NUMBER) { + return makeNumber(countNumber(x.val)); + } + n = 0; + while (x.typ == NODE) { + n = n + 1; + x = x.cdr; + } + return makeNumber(n); +} + +// ------------------------------------------------------------- +// L. Numerical Functions +// ------------------------------------------------------------- + +// +// auxiliary stuff +// + +void zeroDivideError() { + error("ZERO Divide Error", false); +} + +// +// end of auxiliary stuff +// + +Cell minus(Cell x) { + if (x.typ != NUMBER) { + return nilAtom; + } + return makeNumber(-x.val); +} + +Cell plus(Cell x, Cell y) { + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + return makeNumber(x.val + y.val); +} + +Cell difference(Cell x, Cell y) { + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + return makeNumber(x.val - y.val); +} + +Cell times(Cell x, Cell y) { + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + return makeNumber(x.val * y.val); +} + +Cell quotient(Cell x, Cell y) { + local Integer q; + local Integer r; + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + if (y.val == 0) { + zeroDivideError(); + return nilAtom; + } + q = x.val / y.val; + r = x.val % y.val; + if (r < 0) { + if (q < 0) { + q = q - 1; + } else { + q = q + 1; + } + } + return makeNumber(q); +} + +Cell remainder(Cell x, Cell y) { + local Integer q; + local Integer r; + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + if (y.val == 0) { + zeroDivideError(); + return nilAtom; + } + q = x.val / y.val; + r = x.val % y.val; + if (r < 0) { + if (q < 0) { + r = r + y.val; + } else { + r = r - y.val; + } + } + return makeNumber(r); +} + +Cell divide(Cell x, Cell y) { + local Integer q; + local Integer r; + if (x.typ != NUMBER || y.typ != NUMBER) { + return nilAtom; + } + if (y.val == 0) { + zeroDivideError(); + return nilAtom; + } + q = x.val / y.val; + r = x.val % y.val; + if (r < 0) { + if (q < 0) { + q = q - 1; + r = r + y.val; + } else { + q = q + 1; + r = r - y.val; + } + } + return makeNode(makeNumber(q), makeNumber(r)); +} + +// ------------------------------------------------------------- +// M. Reader Functions and Control Variables +// ------------------------------------------------------------- + +// +// auxiliary stuff +// + +global Boolean singleBreak; + +global Boolean unreadPresent; +global Character unreadChar; + +void unread(Character ch) { + unreadPresent = true; + unreadChar = ch; +} + +Character readChar() { + local Character ch; + if (unreadPresent) { + unreadPresent = false; + return unreadChar; + } + if (rdsAtom.car == nilAtom) { + if (readchAtom.car == nilAtom) { + ch = readCharacter(); + } else { + ch = readCharacter(); + } + } else { + // file input not implemented + ch = ' '; + if (echoAtom.car != nilAtom) { + printChar(ch); + } + } + if (readAtom.car == nilAtom) { + ch = toUpper(ch); + } + return ch; +} + +String readToken(Boolean[] sep, Boolean[] brk) { + local Boolean quoted; + local Character ch; + local StringBuffer strBuf; + quoted = false; + ch = readChar(); + while (ch == '%' || sep[char2int(ch)]) { + if (ch == '%') { + while (readChar() != '%') ; + } + ch = readChar(); + } + if (brk[char2int(ch)]) { + singleBreak = true; + return toString(ch); + } + strBuf = newStringBuffer(20); + while (true) { + if (quoted) { + if (ch == '\"') { + ch = readChar(); + if (ch == '\"') { + addCharToStringBuffer(strBuf, ch); + ch = readChar(); + } else { + quoted = false; + } + } else { + addCharToStringBuffer(strBuf, ch); + ch = readChar(); + } + } else { + if (ch == '\"') { + quoted = true; + ch = readChar(); + } else + if (ch == '%') { + while (readChar() != '%') ; + ch = readChar(); + } else + if (sep[char2int(ch)] || brk[char2int(ch)]) { + unread(ch); + singleBreak = false; + return stringBufferToString(strBuf); + } else { + addCharToStringBuffer(strBuf, ch); + ch = readChar(); + } + } + } +} + +Cell tokenToAtom(String token) { + local Boolean couldConvert; + local Boolean isNegative; + local Integer number; + local Integer i; + local Character ch; + local Integer d; + local Cell aux; + couldConvert = true; + isNegative = false; + number = 0; + i = 0; + if (i < sizeof(token) && token[i] == '-') { + isNegative = true; + i = i + 1; + } + if (i < sizeof(token) && isDigit(token[i])) { + while (i < sizeof(token)) { + ch = token[i]; + i = i + 1; + if (isDigit(ch)) { + d = char2int(ch) - char2int('0'); + if (d < numBase) { + number = number * numBase + d; + } else { + couldConvert = false; + break; + } + } else + if (isAlpha(ch)) { + ch = toUpper(ch); + d = char2int(ch) - char2int('A'); + if (d < numBase) { + number = number * numBase + d; + } else { + couldConvert = false; + break; + } + } else { + couldConvert = false; + break; + } + } + } else { + couldConvert = false; + } + if (couldConvert) { + if (isNegative) { + number = -number; + } + aux = makeNumber(number); + } else { + aux = searchOblist(token); + } + ratomAtom.car = aux; + return aux; +} + +Cell read0(String token) { + local Character ch; + while (true) { + if (!singleBreak) { + return tokenToAtom(token); + } + ch = token[0]; + if (ch == '(') { + token = readToken(RES, REB); + return readList(token); + } else + if (ch == '[') { + token = readToken(RES, REB); + return readBracket(token); + } else + if (ch == ')' || ch == ']' || ch == '.') { + token = readToken(RES, REB); + } else { + error("internal read0 error", true); + } + } +} + +Cell readList(String token) { + local Cell anchor; + local Cell aux; + anchor = makeNode(nilAtom, nilAtom); + anchor.car = anchor; + while (true) { + if (singleBreak && token[0] == ')') { + return anchor.cdr; + } else + if (singleBreak && token[0] == ']') { + unread(']'); + return anchor.cdr; + } else + if (singleBreak && token[0] == '.') { + token = readToken(RES, REB); + aux = read0(token); + token = readToken(RES, REB); + if (singleBreak && token[0] == ')') { + anchor.car.cdr = aux; + return anchor.cdr; + } else + if (singleBreak && token[0] == ']') { + unread(']'); + anchor.car.cdr = aux; + return anchor.cdr; + } else { + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + } + } else { + aux = read0(token); + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + token = readToken(RES, REB); + } + } +} + +Cell readBracket(String token) { + local Cell aux1; + local Cell aux2; + aux1 = readList(token); + while (true) { + token = readToken(RES, REB); + if (singleBreak && token[0] == ')') { + return aux1; + } else + if (singleBreak && token[0] == ']') { + return aux1; + } else { + aux2 = readList(token); + aux1 = makeNode(aux1, aux2); + } + } +} + +// +// end of auxiliary stuff +// + +Cell rds(Cell x, Cell y, Cell z) { + // file handling not implemented + // error("RDS not implemented", false); + return nilAtom; +} + +Cell ratom() { + local String token; + token = readToken(RAS, RAB); + return tokenToAtom(token); +} + +Cell read() { + local String token; + token = readToken(RES, REB); + return read0(token); +} + +Cell readch() { + local Character ch; + local Integer n; + local String s; + local Cell aux; + ch = readChar(); + if (isDigit(ch)) { + n = char2int(ch) - char2int('0'); + if (n < numBase) { + aux = makeNumber(n); + } else { + s = toString(ch); + aux = searchOblist(s); + } + } else { + s = toString(ch); + aux = searchOblist(s); + } + ratomAtom.car = aux; + return aux; +} + +// ------------------------------------------------------------- +// N. Printer Functions and Control Variables +// ------------------------------------------------------------- + +// +// auxiliary stuff +// + +void putConsole(Character ch) { + // do any terminal-specific character translations here + writeCharacter(ch); +} + +void printChar(Character ch) { + local Integer ascii; + // handle case conversion + if (printAtom.car == nilAtom) { + ch = toLower(ch); + } + // determine output sink + if (wrsAtom.car == nilAtom) { + putConsole(ch); + } else { + // file output not implemented + if (echoAtom.car != nilAtom) { + putConsole(ch); + } + } + // update cursor position + ascii = char2int(ch); + if (ascii == 8) { + // CTRL-H, backspace + cursPos = cursPos - 1; + } else + if (ascii == 9) { + // CTRL-I, tab + cursPos = ((cursPos + 8) / 8) * 8; + } else + if (ascii == 10) { + // CTRL-J, begin of next line + cursPos = 0; + } else + if (ascii == 11) { + // CTRL-K, begin of previous line + cursPos = 0; + } else + if (ascii == 12) { + // CTRL-L, begin of screen + cursPos = 0; + } else + if (ascii == 13) { + // CTRL-M, begin of current line + cursPos = 0; + } else { + // all other characters + cursPos = cursPos + 1; + } +} + +Boolean isSpecial(Character ch) { + local Integer index; + index = char2int(ch); + return OSP[index] || REB[index] || RES[index]; +} + +void printName(String s) { + local Integer n; + local Integer i; + local Character ch; + local Boolean quoted; + n = sizeof(s); + i = 0; + quoted = false; + while (i < n) { + ch = s[i]; + if (prin1Atom.car == nilAtom && isSpecial(ch) && !quoted) { + quoted = true; + printChar('\"'); + } + printChar(ch); + if (ch == '\"' && quoted) { + printChar('\"'); + } + i = i + 1; + } + if (quoted) { + printChar('\"'); + } +} + +void printNumber(Integer n) { + local Integer a; + local Integer b; + if (n < 0) { + printChar('-'); + n = -n; + } + a = n / numBase; + if (a != 0) { + printNumber(a); + } + b = n % numBase; + if (b < 10) { + printChar(int2char(char2int('0') + b)); + } else { + if (a == 0) { + // this is the first digit printed, and it is >= 10 + // prepend a single zero to distinguish number from name + printChar('0'); + } + printChar(int2char(char2int('A') + (b - 10))); + } +} + +// +// end of auxiliary stuff +// + +Cell wrs(Cell x, Cell y, Cell z) { + // file handling not implemented + // error("WRS not implemented", false); + return nilAtom; +} + +Cell print(Cell x) { + prin1(x); + printChar('\n'); + return x; +} + +Cell prin1(Cell x) { + if (x.typ == NAME) { + printName(x.name); + return x; + } + if (x.typ == NUMBER) { + printNumber(x.val); + return x; + } + printChar('('); + prin1(x.car); + x = x.cdr; + while (x.typ == NODE) { + printChar(' '); + prin1(x.car); + x = x.cdr; + } + if (x != nilAtom) { + printChar(' '); + printChar('.'); + printChar(' '); + prin1(x); + } + printChar(')'); + return x; +} + +Cell terpri(Cell x) { + local Integer n; + if (x.typ == NUMBER) { + n = x.val; + if (n < 0 || n > 255) { + printChar('\n'); + return nilAtom; + } + while (n > 0) { + printChar('\n'); + n = n - 1; + } + return nilAtom; + } + printChar('\n'); + return nilAtom; +} + +Cell spaces(Cell x) { + local Integer n; + if (x.typ == NUMBER) { + n = x.val; + if (n < 0 || n > 255) { + return makeNumber(cursPos); + } + while (n > 0) { + printChar(' '); + n = n - 1; + } + return makeNumber(cursPos); + } + return makeNumber(cursPos); +} + +Cell linelength(Cell x) { + local Integer n; + local Cell aux; + if (x.typ == NUMBER) { + n = x.val; + if (n > 11 && n < 256) { + aux = makeNumber(lineLen); + lineLen = n; + return aux; + } + return makeNumber(lineLen); + } + return makeNumber(lineLen); +} + +Cell radix(Cell x) { + local Integer n; + local Cell aux; + if (x.typ == NUMBER) { + n = x.val; + if (n > 1 && n < 37) { + aux = makeNumber(numBase); + numBase = n; + return aux; + } + return makeNumber(numBase); + } + return makeNumber(numBase); +} + +// ------------------------------------------------------------- +// O. Evaluation Functions +// ------------------------------------------------------------- + +// +// auxiliary stuff +// + +Cell evlis(Cell x) { + local Cell anchor; + local Cell aux; + anchor = makeNode(nilAtom, nilAtom); + anchor.car = anchor; + while (x.typ == NODE) { + aux = eval(x.car); + anchor.car.cdr = makeNode(aux, nilAtom); + anchor.car = anchor.car.cdr; + x = x.cdr; + } + anchor.car.cdr = x; + return anchor.cdr; +} + +Cell evalbody(Cell x, Cell y) { + local Cell aux; + aux = x; + while (y.typ == NODE) { + if (y.car.typ != NODE || y.car.car.typ != NODE) { + aux = eval(y.car); + y = y.cdr; + } else + if (y.car.car.car.typ != NODE) { + aux = eval(y.car.car); + if (aux == nilAtom) { + y = y.cdr; + } else { + y = y.car.cdr; + } + } else { + aux = evalbody(aux, y.car); + y = y.cdr; + } + } + return aux; +} + +void bind(Cell x, Cell y) { + if (x.typ != NODE) { + if (x != nilAtom) { + argStack = makeNode(x.car, argStack); + x.car = y; + } + return; + } + while (x.typ == NODE && y.typ == NODE) { + argStack = makeNode(x.car.car, argStack); + x.car.car = y.car; + x = x.cdr; + y = y.cdr; + } + while (x.typ == NODE) { + argStack = makeNode(x.car.car, argStack); + x.car.car = nilAtom; + x = x.cdr; + } +} + +void unbind(Cell x) { + local Cell aux; + if (x.typ != NODE) { + if (x != nilAtom) { + x.car = argStack.car; + argStack = argStack.cdr; + } + return; + } + aux = nilAtom; + while (x.typ == NODE) { + aux = makeNode(x.car, aux); + x = x.cdr; + } + while (aux.typ == NODE) { + aux.car.car = argStack.car; + argStack = argStack.cdr; + aux = aux.cdr; + } +} + +// +// end of auxiliary stuff +// + +Cell quote(Cell x) { + // ATTENTION: CBN + return x.car; +} + +Cell eval(Cell x) { + local Cell aux; + if (x.typ != NODE) { + return x.car; + } + if (x.car.typ == NAME) { + if (x.car.func == nilAtom) { + if (x.car == x.car.car) { + return evlis(x); + } + aux = makeNode(x.car.car, x.cdr); + return eval(aux); + } + if (x.car.func.car == subrAtom || + x.car.func.car == lambdaAtom) { + aux = evlis(x.cdr); + return apply(x.car, aux); + } + if (x.car.func.car == nsubrAtom || + x.car.func.car == nlambdaAtom) { + return apply(x.car, x.cdr); + } + return evlis(x); + } + if (x.car.car == lambdaAtom) { + aux = evlis(x.cdr); + return apply(x.car, aux); + } + if (x.car.car == nlambdaAtom) { + return apply(x.car, x.cdr); + } + return evlis(x); +} + +Cell apply(Cell x, Cell y) { + local Cell aux; + if (x.typ == NAME) { + if (x.func == nilAtom) { + if (x == x.car) { + return nilAtom; + } + return apply(x.car, y); + } + if (x.func.car == subrAtom) { + if (y.typ != NODE) { + return exec(x.func.cdr.val, nilAtom, nilAtom, nilAtom); + } + if (y.cdr.typ != NODE) { + return exec(x.func.cdr.val, y.car, nilAtom, nilAtom); + } + if (y.cdr.cdr.typ != NODE) { + return exec(x.func.cdr.val, y.car, y.cdr.car, nilAtom); + } + return exec(x.func.cdr.val, y.car, y.cdr.car, y.cdr.cdr.car); + } + if (x.func.car == nsubrAtom) { + return exec(x.func.cdr.val, y, nilAtom, nilAtom); + } + if (x.func.car == lambdaAtom || x.func.car == nlambdaAtom) { + bind(x.func.cdr.car, y); + aux = evalbody(nilAtom, x.func.cdr.cdr); + unbind(x.func.cdr.car); + return aux; + } + return nilAtom; + } + if (x.car == lambdaAtom || x.car == nlambdaAtom) { + bind(x.cdr.car, y); + aux = evalbody(nilAtom, x.cdr.cdr); + unbind(x.cdr.car); + return aux; + } + return nilAtom; +} + +Cell cond(Cell x) { + // ATTENTION: CBN + local Cell aux; + while (x.typ == NODE) { + aux = eval(x.car.car); + if (aux != nilAtom) { + return evalbody(aux, x.car.cdr); + } + x = x.cdr; + } + return nilAtom; +} + +Cell loop(Cell x) { + // ATTENTION: CBN + local Cell aux1; + local Cell aux2; + while (true) { + aux1 = x; + while (aux1.typ == NODE) { + if (aux1.car.typ != NODE || aux1.car.car.typ != NODE) { + eval(aux1.car); + aux1 = aux1.cdr; + } else + if (aux1.car.car.car.typ != NODE) { + aux2 = eval(aux1.car.car); + if (aux2 != nilAtom) { + return evalbody(aux2, aux1.car.cdr); + } + aux1 = aux1.cdr; + } else { + evalbody(nilAtom, aux1.car); + aux1 = aux1.cdr; + } + } + } +} + +Cell prog1(Cell x) { + // ATTENTION: CBN + local Cell aux; + aux = eval(x.car); + x = x.cdr; + while (x.typ == NODE) { + eval(x.car); + x = x.cdr; + } + return aux; +} + +Cell driver() { + local Cell aux1; + local Cell aux2; + rdsAtom.car = nilAtom; + wrsAtom.car = nilAtom; + echoAtom.car = nilAtom; + readchAtom.car = readchAtom; + while (true) { + printChar('\n'); + printChar('$'); + printChar('\n'); + //printChar('\n'); + //printChar('$'); + //printChar(' '); + aux1 = read(); + aux2 = eval(aux1); + print(aux2); + } + // never reached + return nilAtom; +} + +// ------------------------------------------------------------- +// P. Memory Management Functions +// ------------------------------------------------------------- + +Cell reclaim() { + // not implemented + error("RECLAIM not implemented", false); + return nilAtom; +} + +// ------------------------------------------------------------- +// Q. Environment Functions +// ------------------------------------------------------------- + +Cell save(Cell x, Cell y) { + error("SAVE not implemented", false); + return nilAtom; +} + +Cell load(Cell x, Cell y) { + error("LOAD not implemented", false); + return nilAtom; +} + +Cell system() { + writeString("\nThanks for using Ninja LISP!\n\n"); + exit(); + // never reached + return nilAtom; +} + +// ------------------------------------------------------------- +// R. Mutator Functions +// ------------------------------------------------------------- + +Cell xchgpname(Cell x, Cell y) { + local String name; + if (x.typ != NAME || y.typ != NAME) { + return nilAtom; + } + name = x.name; + x.name = y.name; + y.name = name; + return tAtom; +} + +Cell purgename(Cell x) { + local Cell aux; + if (x.typ != NAME) { + return nilAtom; + } + aux = objectList; + if (aux.typ == NODE) { + if (aux.car == x) { + objectList = aux.cdr; + return tAtom; + } + while (aux.cdr.typ == NODE) { + if (aux.cdr.car == x) { + aux.cdr = aux.cdr.cdr; + return tAtom; + } + aux = aux.cdr; + } + } + return nilAtom; +} + +// ------------------------------------------------------------- +// Main Program +// ------------------------------------------------------------- + +void initConstants() { + NAME = 0; + NUMBER = 1; + NODE = 2; +} + +void initCharTypes() { + local Integer i; + RAS = new(Boolean[128]); + RAB = new(Boolean[128]); + RES = new(Boolean[128]); + REB = new(Boolean[128]); + OSP = new(Boolean[128]); + i = 0; + while (i < 128) { + RAS[i] = false; + RAB[i] = false; + RES[i] = false; + REB[i] = false; + OSP[i] = false; + i = i + 1; + } + // ratom separator characters + RAS[char2int(' ')] = true; + RAS[char2int('\r')] = true; + RAS[char2int('\n')] = true; + RAS[char2int('\t')] = true; + // ratom break characters + RAB[char2int('!')] = true; + RAB[char2int('$')] = true; + RAB[char2int('&')] = true; + RAB[char2int('\'')] = true; + RAB[char2int('(')] = true; + RAB[char2int(')')] = true; + RAB[char2int('*')] = true; + RAB[char2int('+')] = true; + RAB[char2int(',')] = true; + RAB[char2int('-')] = true; + RAB[char2int('.')] = true; + RAB[char2int('/')] = true; + RAB[char2int('@')] = true; + RAB[char2int(':')] = true; + RAB[char2int(';')] = true; + RAB[char2int('<')] = true; + RAB[char2int('=')] = true; + RAB[char2int('>')] = true; + RAB[char2int('?')] = true; + RAB[char2int('[')] = true; + RAB[char2int('\\')] = true; + RAB[char2int(']')] = true; + RAB[char2int('^')] = true; + RAB[char2int('_')] = true; + RAB[char2int('`')] = true; + RAB[char2int('{')] = true; + RAB[char2int('|')] = true; + RAB[char2int('}')] = true; + RAB[char2int('~')] = true; + // read separator characters + RES[char2int(' ')] = true; + RES[char2int(',')] = true; + RES[char2int('\r')] = true; + RES[char2int('\n')] = true; + RES[char2int('\t')] = true; + // read break characters + REB[char2int('(')] = true; + REB[char2int(')')] = true; + REB[char2int('.')] = true; + REB[char2int('[')] = true; + REB[char2int(']')] = true; + // other special characters + OSP[char2int('\"')] = true; + OSP[char2int('%')] = true; +} + +void initObjects() { + // init NIL, objectList, and argStack + nilAtom = makeNil(); + objectList = nilAtom; + addOblist(nilAtom); + argStack = nilAtom; + // init other objects and functions + tAtom = makeObject("T"); + subrAtom = makeObject("SUBR"); + nsubrAtom = makeObject("NSUBR"); + lambdaAtom = makeObject("LAMBDA"); + nlambdaAtom = makeObject("NLAMBDA"); + echoAtom = makeObject("ECHO"); + readAtom = makeBuiltin("READ", subrAtom, 64); + ratomAtom = makeBuiltin("RATOM", subrAtom, 63); + readchAtom = makeBuiltin("READCH", subrAtom, 65); + rdsAtom = makeBuiltin("RDS", subrAtom, 62); + printAtom = makeBuiltin("PRINT", subrAtom, 67); + prin1Atom = makeBuiltin("PRIN1", subrAtom, 68); + wrsAtom = makeBuiltin("WRS", subrAtom, 66); + driverAtom = makeBuiltin("DRIVER", subrAtom, 79); + carAtom = makeBuiltin("CAR", subrAtom, 0); + cdrAtom = makeBuiltin("CDR", subrAtom, 1); + cadrAtom = makeBuiltin("CADR", subrAtom, 3); + cddrAtom = makeBuiltin("CDDR", subrAtom, 5); + caddrAtom = makeBuiltin("CADDR", subrAtom, 9); + cdddrAtom = makeBuiltin("CDDDR", subrAtom, 13); + caarAtom = makeBuiltin("CAAR", subrAtom, 2); + cdarAtom = makeBuiltin("CDAR", subrAtom, 4); + caaarAtom = makeBuiltin("CAAAR", subrAtom, 6); + cdaarAtom = makeBuiltin("CDAAR", subrAtom, 10); + cadarAtom = makeBuiltin("CADAR", subrAtom, 8); + cddarAtom = makeBuiltin("CDDAR", subrAtom, 12); + caadrAtom = makeBuiltin("CAADR", subrAtom, 7); + cdadrAtom = makeBuiltin("CDADR", subrAtom, 11); + consAtom = makeBuiltin("CONS", subrAtom, 14); + rplacaAtom = makeBuiltin("RPLACA", subrAtom, 18); + rplacdAtom = makeBuiltin("RPLACD", subrAtom, 19); + nconcAtom = makeBuiltin("NCONC", subrAtom, 20); + setAtom = makeBuiltin("SET", subrAtom, 38); + assocAtom = makeBuiltin("ASSOC", subrAtom, 42); + putAtom = makeBuiltin("PUT", subrAtom, 44); + getAtom = makeBuiltin("GET", subrAtom, 43); + memberAtom = makeBuiltin("MEMBER", subrAtom, 31); + rempropAtom = makeBuiltin("REMPROP", subrAtom, 45); + flagpAtom = makeBuiltin("FLAGP", subrAtom, 46); + flagAtom = makeBuiltin("FLAG", subrAtom, 47); + remflagAtom = makeBuiltin("REMFLAG", subrAtom, 48); + movdAtom = makeBuiltin("MOVD", subrAtom, 51); + putdAtom = makeBuiltin("PUTD", subrAtom, 50); + getdAtom = makeBuiltin("GETD", subrAtom, 49); + packAtom = makeBuiltin("PACK", subrAtom, 52); + unpackAtom = makeBuiltin("UNPACK", subrAtom, 53); + lengthAtom = makeBuiltin("LENGTH", subrAtom, 54); + reverseAtom = makeBuiltin("REVERSE", subrAtom, 16); + oblistAtom = makeBuiltin("OBLIST", subrAtom, 17); + atomAtom = makeBuiltin("ATOM", subrAtom, 23); + nameAtom = makeBuiltin("NAME", subrAtom, 21); + nullAtom = makeBuiltin("NULL", subrAtom, 24); + notAtom = makeBuiltin("NOT", subrAtom, 35); + orderpAtom = makeBuiltin("ORDERP", subrAtom, 34); + orderedAtom = makeObject("ORDERED"); + eqAtom = makeBuiltin("EQ", subrAtom, 29); + equalAtom = makeBuiltin("EQUAL", subrAtom, 30); + applyAtom = makeBuiltin("APPLY", subrAtom, 75); + evalAtom = makeBuiltin("EVAL", subrAtom, 74); + reclaimAtom = makeBuiltin("RECLAIM", subrAtom, 80); + terpriAtom = makeBuiltin("TERPRI", subrAtom, 69); + spacesAtom = makeBuiltin("SPACES", subrAtom, 70); + linelengthAtom = makeBuiltin("LINELENGTH", subrAtom, 71); + radixAtom = makeBuiltin("RADIX", subrAtom, 72); + loadAtom = makeBuiltin("LOAD", subrAtom, 82); + saveAtom = makeBuiltin("SAVE", subrAtom, 81); + systemAtom = makeBuiltin("SYSTEM", subrAtom, 83); + numberpAtom = makeBuiltin("NUMBERP", subrAtom, 22); + greaterpAtom = makeBuiltin("GREATERP", subrAtom, 32); + lesspAtom = makeBuiltin("LESSP", subrAtom, 33); + pluspAtom = makeBuiltin("PLUSP", subrAtom, 25); + minuspAtom = makeBuiltin("MINUSP", subrAtom, 26); + zeropAtom = makeBuiltin("ZEROP", subrAtom, 27); + evenAtom = makeBuiltin("EVEN", subrAtom, 28); + minusAtom = makeBuiltin("MINUS", subrAtom, 55); + plusAtom = makeBuiltin("PLUS", subrAtom, 56); + differenceAtom = makeBuiltin("DIFFERENCE", subrAtom, 57); + timesAtom = makeBuiltin("TIMES", subrAtom, 58); + divideAtom = makeBuiltin("DIVIDE", subrAtom, 61); + quotientAtom = makeBuiltin("QUOTIENT", subrAtom, 59); + remainderAtom = makeBuiltin("REMAINDER", subrAtom, 60); + listAtom = makeBuiltin("LIST", nsubrAtom, 15); + quoteAtom = makeBuiltin("QUOTE", nsubrAtom, 73); + condAtom = makeBuiltin("COND", nsubrAtom, 76); + loopAtom = makeBuiltin("LOOP", nsubrAtom, 77); + prog1Atom = makeBuiltin("PROG1", nsubrAtom, 78); + andAtom = makeBuiltin("AND", nsubrAtom, 36); + orAtom = makeBuiltin("OR", nsubrAtom, 37); + setqAtom = makeBuiltin("SETQ", nsubrAtom, 39); + popAtom = makeBuiltin("POP", nsubrAtom, 40); + pushAtom = makeBuiltin("PUSH", nsubrAtom, 41); + xchgpnameAtom = makeBuiltin("XCHGPNAME", subrAtom, 84); + purgenameAtom = makeBuiltin("PURGENAME", subrAtom, 85); +} + +void initCtlVars() { + unreadPresent = false; + rdsAtom.car = nilAtom; + readAtom.car = readAtom; + readchAtom.car = readchAtom; + echoAtom.car = nilAtom; + wrsAtom.car = nilAtom; + printAtom.car = printAtom; + prin1Atom.car = prin1Atom; + cursPos = 0; + lineLen = 79; + numBase = 10; +} + +void main() { + // write greeting + writeString("\nWelcome to Ninja LISP!\n"); + // initialization + initConstants(); + initCharTypes(); + initObjects(); + initCtlVars(); + // start interpreter + while (true) { + apply(driverAtom, nilAtom); + } +} diff --git a/njvm.o b/njvm.o index 3b34aee..ba6a526 100644 Binary files a/njvm.o and b/njvm.o differ diff --git a/support.o b/support.o index e0fc0d2..62e063e 100644 Binary files a/support.o and b/support.o differ