1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-26 05:08:06 +11:00

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 ! H@ ORG !
JMP8, L1 FWR8 ( start ) JMP8, L1 FWR8 ( start )
L2 BSET ( msg ) L2 BSET ( msg ) ," Hello, World!" 0 A,
," Hello, World!" 0 A,
L1 FSET ( start ) L1 FSET ( start )
CLI, CLI, AH 0 MOVri, AL 2 MOVri, 0x10 INT,
AH 0 MOVri, SI L2 @ ( msg ) MOVrI, AH 0x0e MOVri,
AL 2 MOVri, L1 BSET ( loop ) LODSB, AL AL ORrr,
0x10 INT, JZ, L2 FWR8 ( next ) 0x10 INT,
SI L2 @ ( msg ) MOVrI, JMP8, L1 ( loop ) BWR
AH 0x0e MOVri, L2 FSET ( next ) AH 0 MOVri, 0x16 INT,
LODSB, AH 0x0e MOVri, 0x16 INT, HLT,
AL AL ORrr,
PC ORG @ DUMP PC ORG @ DUMP

View File

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

View File

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