mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 17:28:05 +11:00
Compare commits
No commits in common. "66b27b0790be6caf55e3d486d204161caac2f23b" and "405444d630c1ad97288c11bccda07527a9a1cfb1" have entirely different histories.
66b27b0790
...
405444d630
2
blk/001
2
blk/001
@ -10,7 +10,7 @@ MASTER INDEX
|
|||||||
550 TI-84+ Recipe 580 RC2014 Recipe
|
550 TI-84+ Recipe 580 RC2014 Recipe
|
||||||
620 Sega Master System Recipe
|
620 Sega Master System Recipe
|
||||||
650 AVR assembler 730 8086 assembler
|
650 AVR assembler 730 8086 assembler
|
||||||
810 PC/AT Recipe
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
blk/730
2
blk/730
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Work in progress. Load with "750 LOAD".
|
Work in progress. Load with "750 LOAD".
|
||||||
|
|
||||||
|
Test code at B731
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
3
blk/751
3
blk/751
@ -1,8 +1,5 @@
|
|||||||
VARIABLE ORG
|
VARIABLE ORG
|
||||||
CREATE BIN( 0 , : BIN(+ BIN( @ + ;
|
|
||||||
VARIABLE L1 VARIABLE L2 VARIABLE L3 VARIABLE L4
|
|
||||||
: AL 0 ; : CL 1 ; : DL 2 ; : BL 3 ;
|
: AL 0 ; : CL 1 ; : DL 2 ; : BL 3 ;
|
||||||
: AH 4 ; : CH 5 ; : DH 6 ; : BH 7 ;
|
: AH 4 ; : CH 5 ; : DH 6 ; : BH 7 ;
|
||||||
: AX 8 ; : CX 9 ; : DX 10 ; : BX 11 ;
|
: AX 8 ; : CX 9 ; : DX 10 ; : BX 11 ;
|
||||||
: SP 12 ; : BP 13 ; : SI 14 ; : DI 15 ;
|
: SP 12 ; : BP 13 ; : SI 14 ; : DI 15 ;
|
||||||
: ES 0 ; : CS 1 ; : SS 2 ; : DS 3 ;
|
|
||||||
|
8
blk/752
8
blk/752
@ -1,8 +1,2 @@
|
|||||||
( Splits word into msb/lsb, lsb being on TOS )
|
: PC H@ ORG @ - ;
|
||||||
: SPLITB
|
|
||||||
256 /MOD SWAP
|
|
||||||
;
|
|
||||||
: PC H@ ORG @ - BIN( @ + ;
|
|
||||||
: A, C, ;
|
: A, C, ;
|
||||||
( dst8 src8 -- modrm )
|
|
||||||
: MODRMrr 0x7 AND 3 LSHIFT SWAP 0x7 AND OR 0xc0 OR ;
|
|
||||||
|
9
blk/753
9
blk/753
@ -1,10 +1 @@
|
|||||||
: MOVri, SWAP 0xb0 OR A, A, ;
|
: MOVri, SWAP 0xb0 OR A, A, ;
|
||||||
: MOVrI, SWAP 0xb0 OR A, SPLITB A, A, ;
|
|
||||||
: MOVsx, 0x8e A, SWAP MODRMrr A, ;
|
|
||||||
: INT, 0xcd A, A, ;
|
|
||||||
( no argument, flow ops are special )
|
|
||||||
: JMP8, 0xeb A, ; : JMP16, 0xe9 A, ; : JZ, 0x74 A, ;
|
|
||||||
: LODSB, 0xac A, ; : CLI, 0xfa A, ; : HLT, 0xf4 A, ;
|
|
||||||
: ORrr, 0x08 A, MODRMrr A, ;
|
|
||||||
: XORxx, 0x31 A, MODRMrr A, ;
|
|
||||||
: CLD, 0xfc A, ; : STD, 0xfd A, ;
|
|
||||||
|
16
blk/754
16
blk/754
@ -1,16 +0,0 @@
|
|||||||
( Place BEGIN, where you want to jump back and AGAIN after
|
|
||||||
a relative jump operator. Just like BSET and BWR. )
|
|
||||||
: BEGIN, PC ;
|
|
||||||
: BSET PC SWAP ! ;
|
|
||||||
( same as BSET, but we need to write a placeholder )
|
|
||||||
( : FJR, PC 0 A, ;
|
|
||||||
: IFZ, JRNZ, FJR, ;
|
|
||||||
: IFNZ, JRZ, FJR, ;
|
|
||||||
: IFC, JRNC, FJR, ;
|
|
||||||
: IFNC, JRC, FJR, ; )
|
|
||||||
: THEN,
|
|
||||||
DUP PC ( l l pc )
|
|
||||||
-^ 1- ( l off )
|
|
||||||
( warning: l is a PC offset, not a mem addr! )
|
|
||||||
SWAP ORG @ + BIN( @ - ( off addr )
|
|
||||||
C! ;
|
|
9
blk/755
9
blk/755
@ -1,9 +0,0 @@
|
|||||||
: FWR8 BSET 0 A, ;
|
|
||||||
: FSET @ THEN, ;
|
|
||||||
( : BREAK, FJR, 0x8000 OR ;
|
|
||||||
: BREAK?, DUP 0x8000 AND IF
|
|
||||||
0x7fff AND 1 ALLOT THEN, -1 ALLOT
|
|
||||||
THEN ; )
|
|
||||||
: AGAIN, ( BREAK?, ) PC - 1- A, ;
|
|
||||||
: BWR @ AGAIN, ;
|
|
||||||
|
|
14
blk/811
14
blk/811
@ -1,14 +0,0 @@
|
|||||||
: _filler 510 H@ ORG @ - DO 0 A, LOOP 0x55 A, 0xaa A, ;
|
|
||||||
H@ ORG ! 0x7c00 BIN( ! ( BIOS loads boot bin at 0x7c00 )
|
|
||||||
JMP8, L1 FWR8 ( start )
|
|
||||||
L2 BSET ( msg ) ," Hello, World!" 0 A,
|
|
||||||
L1 FSET ( start )
|
|
||||||
CLI, CLD, AX AX XORxx, DS AX MOVsx,
|
|
||||||
AH 0 MOVri, AL 2 MOVri, ( 80x25 BW video mode ) 0x10 INT,
|
|
||||||
SI L2 @ ( msg ) MOVrI, AH 0x0e MOVri, ( print char )
|
|
||||||
L1 BSET ( loop ) LODSB, AL AL ORrr, ( end of str? )
|
|
||||||
JZ, L2 FWR8 ( next ) 0x10 INT, ( print char )
|
|
||||||
JMP8, L1 ( loop ) BWR
|
|
||||||
L2 FSET ( next ) AH 0 MOVri, 0x16 INT, ( read kbd )
|
|
||||||
AH 0x0e MOVri, 0x10 INT, ( spit read char ) HLT, ( done )
|
|
||||||
_filler
|
|
@ -1,16 +0,0 @@
|
|||||||
TARGET = boot.bin
|
|
||||||
BASEDIR = ../..
|
|
||||||
EDIR = $(BASEDIR)/emul
|
|
||||||
STAGE = $(EDIR)/stage
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
all: $(TARGET)
|
|
||||||
$(TARGET): xcomp.fs $(STAGE)
|
|
||||||
cat xcomp.fs | $(STAGE) > $@
|
|
||||||
|
|
||||||
$(STAGE):
|
|
||||||
$(MAKE) -C $(EDIR) stage
|
|
||||||
|
|
||||||
.PHONY: emul
|
|
||||||
emul: $(TARGET)
|
|
||||||
qemu-system-i386 -fda $(TARGET)
|
|
@ -1,3 +0,0 @@
|
|||||||
# PC/AT recipe
|
|
||||||
|
|
||||||
Work in progress.
|
|
@ -1,4 +0,0 @@
|
|||||||
750 LOAD
|
|
||||||
811 LOAD
|
|
||||||
ORG @ 256 /MOD 2 PC! 2 PC!
|
|
||||||
H@ 256 /MOD 2 PC! 2 PC!
|
|
Loading…
Reference in New Issue
Block a user