8086asm: now enough tooling to assemble a PC/AT Hello World boot

This commit is contained in:
Virgil Dupras 2020-06-12 13:12:41 -04:00
parent 210b833c71
commit 4e18fafe46
3 changed files with 13 additions and 17 deletions

18
blk/731
View File

@ -1,14 +1,12 @@
H@ ORG !
JMP8, L1 FWR8 ( start )
L2 BSET ( msg )
," Hello, World!" 0 A,
L2 BSET ( msg ) ," Hello, World!" 0 A,
L1 FSET ( start )
CLI,
AH 0 MOVri,
AL 2 MOVri,
0x10 INT,
SI L2 @ ( msg ) MOVrI,
AH 0x0e MOVri,
LODSB,
AL AL ORrr,
CLI, AH 0 MOVri, AL 2 MOVri, 0x10 INT,
SI L2 @ ( msg ) MOVrI, AH 0x0e MOVri,
L1 BSET ( loop ) LODSB, AL AL ORrr,
JZ, L2 FWR8 ( next ) 0x10 INT,
JMP8, L1 ( loop ) BWR
L2 FSET ( next ) AH 0 MOVri, 0x16 INT,
AH 0x0e MOVri, 0x16 INT, HLT,
PC ORG @ DUMP

View File

@ -2,8 +2,6 @@
: MOVrI, SWAP 0xb0 OR A, SPLITB A, A, ;
: INT, 0xcd A, A, ;
( no argument, flow ops are special )
: JMP8, 0xeb A, ;
: JMP16, 0xe9 A, ;
: LODSB, 0xac A, ;
: CLI, 0xfa A, ;
: JMP8, 0xeb A, ; : JMP16, 0xe9 A, ; : JZ, 0x74 A, ;
: LODSB, 0xac A, ; : CLI, 0xfa A, ; : HLT, 0xf4 A, ;
: ORrr, 0x08 A, MODRMrr A, ;

View File

@ -3,7 +3,7 @@
( : BREAK, FJR, 0x8000 OR ;
: BREAK?, DUP 0x8000 AND IF
0x7fff AND 1 ALLOT THEN, -1 ALLOT
THEN ;
: AGAIN, BREAK?, PC - 1- A, ; )
( : BWR @ AGAIN, ; )
THEN ; )
: AGAIN, ( BREAK?, ) PC - 1- A, ;
: BWR @ AGAIN, ;