From e90a728894b56365a17fef96b7483f2e4bb0a66e Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Tue, 16 Nov 2021 10:45:40 -0800 Subject: [PATCH] Unshave four bytes for IBM PC compatibility Ability to run on original hardware is confirmed. --- sectorlisp.S | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sectorlisp.S b/sectorlisp.S index a076734..426df7a 100644 --- a/sectorlisp.S +++ b/sectorlisp.S @@ -20,6 +20,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ // LISP meta-circular evaluator in a MBR +// Compatible with the original hardware .set ATOM_NIL, (kNil-kSymbols)<<1|1 .set ATOM_QUOTE, (kQuote-kSymbols)<<1|1 @@ -38,11 +39,6 @@ .set ONE, %cx .set TWO, %bx -//////////////////////////////////////////////////////////////////////////////// -// Currently requires i386+ in real mode -// Can be easily tuned for the IBM PC XT -// Quoth xed -r -isa-set -i sectorlisp.o - .section .text,"ax",@progbits .type kSymbols,@object .type _begin,@function @@ -73,10 +69,10 @@ _begin: push %cs # memory model ds=es=ss=cs cld # clear direction flag rep stosb # memset(0x8000,0,0x8000) push %ds # cx is now zero -# cli # disable interrupts + cli # disable interrupts pop %ss # disable nonmaskable interrupts mov %ax,%sp # use null pointer as our stack -# sti # enable interrupts + sti # enable interrupts inc ONE # ++cx mov ONE,TWO inc TWO @@ -181,10 +177,10 @@ GetChar: # ah is bios scancode # al is ascii character PutChar: -# push %bp # original ibm pc scroll up bug + push %bp # original ibm pc scroll up bug mov $0x0e,%ah # teletype output al cp437 int $0x10 # vidya service -# pop %bp # preserves al + pop %bp # preserves al cmp $'\r',%al # don't clobber stuff jne .ret mov $'\n',%al