From 21383822a7ed481825ce8f2c82f16fa3aaf0ee16 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sun, 7 Nov 2021 22:28:49 -0800 Subject: [PATCH] Revert "shave another six bytes" This reverts commit 8f5f932098be4cec3de5fb95cfa7efdaa2794efb. --- bin/sectorlisp.bin | Bin 512 -> 512 bytes sectorlisp.S | 43 +++++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/bin/sectorlisp.bin b/bin/sectorlisp.bin index dd5829315356e6344458814eb29fbba5cad432de..cd664257a32b0f41ed4140a858990b36666995af 100755 GIT binary patch delta 406 zcmXAjF-RLx7{|Z&^bp0wp-?RZ4NAZi9SSN4?>5CnB#2s@!8jGf#lpK&L@{te4Nrtb zxSMoxkf?BoLv*mh4K6J-OG~GwIQZGuQmN2hMe_QB%f}ynzyF^vTc53`GLf%KtbOmX zXCWGmb~Kz*d+LQcO~Aw5-mBK!`w|RnRql$%P51 z8R}&t3z>Rb`PhgRqvV)}@lhJmTz9fKr&GWG#|b$?jv~7SMR4;9%Cw`D>j;Im(j6)N z{P!~<%d*>5qn{qT&_OX&BA7vX1|$hQ$Si|(WIvstMLoZ9K^hluA_8+LDy}!8EI30y zO7L;R8?hjOjJRY_`7*2L_f}JM5QdQbWwvq+GcVloaTRE(P*j+W^x6D|Gj1w&8)>C9 za@@V5W@)uh?(;6@jX@Kd4EP|!V*$G+Y6(_XNO2AWK@$SJ2w-eJCSyslx9$uJJe(*r z2+Q0DAKXr}CG2P3f}unhMDeS5VH(9HZPsAUaIQ)Ss6U)@(`z5>@Ywj2Kn=#f4d!_? zU|%wdSr_T0hMLzJ%yKK78w%DkLOQ9N^pyAYV_HlU?Pe{j-RoeD4Z|*rjrTXnRNfzV4qlrI4zQ5Z5 diff --git a/sectorlisp.S b/sectorlisp.S index e8ab8b5..af5be88 100644 --- a/sectorlisp.S +++ b/sectorlisp.S @@ -3,7 +3,6 @@ ╞══════════════════════════════════════════════════════════════════════════════╡ │ Copyright 2020 Justine Alexandra Roberts Tunney │ │ Copyright 2021 Alain Greppin │ -│ Some size optimisations by Peter Ferrie │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ @@ -22,19 +21,19 @@ // LISP meta-circular evaluator in a MBR .set ONE, %bp -.set NIL, 7 -.set ATOM_T, 15 -.set ATOM_QUOTE, 19 -.set ATOM_COND, 31 -.set ATOM_ATOM, 41 -.set ATOM_CAR, 51 -.set ATOM_CDR, 59 -.set ATOM_CONS, 67 -.set ATOM_EQ, 77 +.set NIL, 1 +.set ATOM_T, 9 +.set ATOM_QUOTE, 13 +.set ATOM_COND, 25 +.set ATOM_ATOM, 35 +.set ATOM_CAR, 45 +.set ATOM_CDR, 53 +.set ATOM_CONS, 61 +.set ATOM_EQ, 71 .set g_token, 0x7800 .set g_str, 0x0 -.set g_mem, 0x8000 +.set g_mem, 0x3600 .set boot, 0x7c00 //////////////////////////////////////////////////////////////////////////////// @@ -49,23 +48,27 @@ _start: jmp .init # some bios scan for short jump .type kSymbols,@object; kSymbols: - .ascii "\0NIL\0T\0QUOTE\0COND\0ATOM\0CAR\0CDR\0CONS\0EQ\0" + .ascii "NIL\0T\0QUOTE\0COND\0ATOM\0CAR\0CDR\0CONS\0EQ" .type .init,@function -.init: ljmp $0x7c00>>4,$_begin # end of bios data roundup page -_begin: mov $g_mem,%cx - mov %cx,%fs # fs = &g_mem - xor %ax,%ax - mov %cx,%di - cld - rep stosb # clears our bss memory - push %cs # memory model cs=ds=es = 0x7c0 +.init: ljmp $0x600>>4,$_begin # end of bios data roundup page +_begin: push %cs # memory model cs=ds=es = 0x600 push %cs push %cs pop %ds pop %es + mov $kSymbols,%si + push %si + xor %di,%di # mov g_str, %di + mov $37,%cx + cld + rep movsb + pop %cx pop %ss mov %cx,%sp + mov $g_mem,%ax + mov %ax,%fs # fs = &g_mem + rep stosb # clears our bss memory mov $NIL,ONE main: mov $'\n',%dl call GetToken