mirror of
https://github.com/samsonjs/sectorlisp.git
synced 2026-04-27 14:57:41 +00:00
Unshave four bytes for IBM PC compatibility
Ability to run on original hardware is confirmed.
This commit is contained in:
parent
1e9c7fca35
commit
e90a728894
1 changed files with 5 additions and 9 deletions
14
sectorlisp.S
14
sectorlisp.S
|
|
@ -20,6 +20,7 @@
|
||||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||||
|
|
||||||
// LISP meta-circular evaluator in a MBR
|
// LISP meta-circular evaluator in a MBR
|
||||||
|
// Compatible with the original hardware
|
||||||
|
|
||||||
.set ATOM_NIL, (kNil-kSymbols)<<1|1
|
.set ATOM_NIL, (kNil-kSymbols)<<1|1
|
||||||
.set ATOM_QUOTE, (kQuote-kSymbols)<<1|1
|
.set ATOM_QUOTE, (kQuote-kSymbols)<<1|1
|
||||||
|
|
@ -38,11 +39,6 @@
|
||||||
.set ONE, %cx
|
.set ONE, %cx
|
||||||
.set TWO, %bx
|
.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
|
.section .text,"ax",@progbits
|
||||||
.type kSymbols,@object
|
.type kSymbols,@object
|
||||||
.type _begin,@function
|
.type _begin,@function
|
||||||
|
|
@ -73,10 +69,10 @@ _begin: push %cs # memory model ds=es=ss=cs
|
||||||
cld # clear direction flag
|
cld # clear direction flag
|
||||||
rep stosb # memset(0x8000,0,0x8000)
|
rep stosb # memset(0x8000,0,0x8000)
|
||||||
push %ds # cx is now zero
|
push %ds # cx is now zero
|
||||||
# cli # disable interrupts
|
cli # disable interrupts
|
||||||
pop %ss # disable nonmaskable interrupts
|
pop %ss # disable nonmaskable interrupts
|
||||||
mov %ax,%sp # use null pointer as our stack
|
mov %ax,%sp # use null pointer as our stack
|
||||||
# sti # enable interrupts
|
sti # enable interrupts
|
||||||
inc ONE # ++cx
|
inc ONE # ++cx
|
||||||
mov ONE,TWO
|
mov ONE,TWO
|
||||||
inc TWO
|
inc TWO
|
||||||
|
|
@ -181,10 +177,10 @@ GetChar:
|
||||||
# ah is bios scancode
|
# ah is bios scancode
|
||||||
# al is ascii character
|
# al is ascii character
|
||||||
PutChar:
|
PutChar:
|
||||||
# push %bp # original ibm pc scroll up bug
|
push %bp # original ibm pc scroll up bug
|
||||||
mov $0x0e,%ah # teletype output al cp437
|
mov $0x0e,%ah # teletype output al cp437
|
||||||
int $0x10 # vidya service
|
int $0x10 # vidya service
|
||||||
# pop %bp # preserves al
|
pop %bp # preserves al
|
||||||
cmp $'\r',%al # don't clobber stuff
|
cmp $'\r',%al # don't clobber stuff
|
||||||
jne .ret
|
jne .ret
|
||||||
mov $'\n',%al
|
mov $'\n',%al
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue