1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 06:20:55 +11:00

Compare commits

..

No commits in common. "d041b91846bc8906206212ab118602c7df9f7f96" and "6bff03a48b1734f4e7b5112797f0bc29f4ad0e36" have entirely different histories.

14 changed files with 42 additions and 37 deletions

View File

@ -10,7 +10,8 @@ the dictionary (B30) for a word reference.
Contents Contents
5 Number literals 6 Compilation vs meta-comp. 4 Number literals 6 Compilation vs meta-comp.
8 Interpreter I/O 11 Signed-ness 8 Interpreter I/O 11 Signed-ness
14 Addressed devices 17 DOES> 14 Addressed devices 17 DOES>
18 Disk blocks (cont.) 18 Disk blocks 21 How blocks are organized
22 Addressed devices

12
blk/004
View File

@ -1 +1,11 @@
21 How blocks are organized 22 Addressed devices Number literals
Traditional Forth often use HEX/DEC switches to go from decimal
to hexadecimal parsing. Collapse OS parses literals in a way
that is closer to C.
Straight numbers are decimals, numbers starting with "0x"
are hexadecimals (example "0x12ef"), "0b" prefixes indicate
binary (example "0b1010"), char literals are single characters
surrounded by ' (example 'X'). Char literals can't be used for
whitespaces.

12
blk/005
View File

@ -1,12 +0,0 @@
Number literals
Traditional Forth often use HEX/DEC switches to go from decimal
to hexadecimal parsing. Collapse OS parses literals in a way
that is closer to C.
Straight numbers are decimals, numbers starting with "0x"
are hexadecimals (example "0x12ef"), "0b" prefixes indicate
binary (example "0b1010"), char literals are single characters
surrounded by ' (example 'X'). Char literals can't be used for
whitespaces.

View File

@ -1,10 +1,8 @@
: OP1 CREATE C, DOES> C@ A, ; : OP1 CREATE C, DOES> C@ A, ;
0xf3 OP1 DI, 0xfb OP1 EI, 0xf3 OP1 DI, 0xfb OP1 EI,
0xeb OP1 EXDEHL, 0xd9 OP1 EXX, 0xeb OP1 EXDEHL, 0xd9 OP1 EXX,
0x08 OP1 EXAFAF',
0x76 OP1 HALT, 0xe9 OP1 JP(HL), 0x76 OP1 HALT, 0xe9 OP1 JP(HL),
0x12 OP1 LD(DE)A, 0x1a OP1 LDA(DE), 0x12 OP1 LD(DE)A, 0x1a OP1 LDA(DE),
0x02 OP1 LD(BC)A, 0x0a OP1 LDA(BC),
0x00 OP1 NOP, 0xc9 OP1 RET, 0x00 OP1 NOP, 0xc9 OP1 RET,
0x17 OP1 RLA, 0x07 OP1 RLCA, 0x17 OP1 RLA, 0x07 OP1 RLCA,
0x1f OP1 RRA, 0x0f OP1 RRCA, 0x1f OP1 RRA, 0x0f OP1 RRCA,

View File

@ -1,11 +1,11 @@
CODE (?br) ( 0x67 ) CODE (?br) ( 0x67 )
HL POPqq, HL POPqq, chkPS,
HLZ, HLZ,
JRZ, L2 BWR ( BR + 2. False, branch ) JRZ, L2 BWR ( BR + 2. False, branch )
L1 BSET ( loop will jump here ) L1 BSET ( loop will jump here )
( True, skip next 2 bytes and don't branch ) ( True, skip next 2 bytes and don't branch )
IY INCss, IY INCss, IY INCss, IY INCss,
JPNEXT, NOP, NOP, NOP, JPNEXT,
CODE (loop) ( 0x77 ) CODE (loop) ( 0x77 )
0 IX+ INC(IXY+), IFZ, 1 IX+ INC(IXY+), THEN, ( I++ ) 0 IX+ INC(IXY+), IFZ, 1 IX+ INC(IXY+), THEN, ( I++ )
( Jump if I <> I' ) ( Jump if I <> I' )

View File

@ -1,11 +1,11 @@
CODE >R ( 0xa8 ) CODE >R ( 0xa8 )
HL POPqq, HL POPqq, chkPS,
17 BCALL, ( 17 == pushRS ) 17 BCALL, ( 17 == pushRS )
;CODE NOP, NOP, NOP, ;CODE
CODE 2>R ( 0xb9 ) CODE 2>R ( 0xb9 )
DE POPqq, HL POPqq, DE POPqq, HL POPqq, chkPS,
17 BCALL, ( 17 == pushRS ) EXDEHL, 17 BCALL, 17 BCALL, ( 17 == pushRS ) EXDEHL, 17 BCALL,
;CODE NOP, NOP, NOP, ;CODE
CODE R> ( 0xce ) CODE R> ( 0xce )
20 BCALL, ( 20 == popRS ) 20 BCALL, ( 20 == popRS )
HL PUSHqq, HL PUSHqq,

11
blk/299
View File

@ -1,13 +1,10 @@
PC ORG @ 0x1e + ! ( chkPS ) PC ORG @ 0x1e + ! ( chkPS )
( Note that you only need to call this in words that push HL PUSHqq,
back to PSP. If they don't, calling chkPS is redundant with
check in next )
EXX,
( We have the return address for this very call on the stack ( We have the return address for this very call on the stack
and protected registers. 2 - is to compensate that. ) and protected registers. 4 - is to compensate that. )
HL PS_ADDR 2 - LDddnn, HL PS_ADDR 4 - LDddnn,
SP SUBHLss, SP SUBHLss,
EXX, HL POPqq,
CNC RETcc, ( PS_ADDR >= SP? good ) CNC RETcc, ( PS_ADDR >= SP? good )
JR, L2 BWR ( abortUnderflow-B298 ) JR, L2 BWR ( abortUnderflow-B298 )

View File

@ -1,5 +1,6 @@
CODE PICK CODE PICK
HL POPqq, HL POPqq,
chkPS,
( x2 ) ( x2 )
L SLAr, H RLr, L SLAr, H RLr,
SP ADDHLss, SP ADDHLss,

View File

@ -2,6 +2,7 @@
CODE 2DROP CODE 2DROP
HL POPqq, HL POPqq,
HL POPqq, HL POPqq,
chkPS,
;CODE ;CODE
( a b -- a b a b ) ( a b -- a b a b )

View File

@ -1,6 +1,7 @@
CODE ! CODE !
HL POPqq, HL POPqq,
DE POPqq, DE POPqq,
chkPS,
(HL) E LDrr, (HL) E LDrr,
HL INCss, HL INCss,
(HL) D LDrr, (HL) D LDrr,

View File

@ -1,6 +1,7 @@
CODE C! CODE C!
HL POPqq, HL POPqq,
DE POPqq, DE POPqq,
chkPS,
(HL) E LDrr, (HL) E LDrr,
;CODE ;CODE

View File

@ -1,6 +1,7 @@
CODE PC! CODE PC!
BC POPqq, BC POPqq,
HL POPqq, HL POPqq,
chkPS,
L OUT(C)r, L OUT(C)r,
;CODE ;CODE

Binary file not shown.

View File

@ -34,13 +34,19 @@ I don't think you need a schematic. It's really simple.
### Building the binary ### Building the binary
The binary from the base recipe has almost all it needs to write to EEPROM. The You build the binary by modifying the base recipe's `xcomp` unit. This binary
only thing it needs is the AT28 driver from B590. You could add it to the is missing 2 things: Addressed devices and the AT28 Driver.
`xcomp` unit and rebuild, but the driver is so tiny, you're probably better off
loading it at runtime.
If your system has mass storage, it's as easy as a LOAD. If it doesn't, you Addressed devices are at B140. If you read that block, you'll see that it tells
can use `/tools/exec` to send `blk/591` to the RC2014. you to load block 142. Open the `xcomp` unit and locate the ACIA driver loading
line. Insert your new load line after that one.
Do the same thing with the AT28 driver (B590)
You also have to modify the initialization sequence at the end of the `xcomp`
unit to include `ADEV$`.
Build again, write `os.com` to EEPROM.
## Writing contents to the AT28 ## Writing contents to the AT28
@ -52,7 +58,7 @@ run this from your modern computer:
./upload <tty device> a000 <filename> ./upload <tty device> a000 <filename>
Then, activate `AT28!` with `' AT28! A!* !` and then run Then, activate `AT28!` with `' AT28! A!* !` and then run
`0xa000 0x2000 <size-of-bin> AMOVE`. `AT28!` checks every byte for integrity, `0xa000 0x2000 <size-of-bin> AMOVE`. `AT28!` checks every myte for integrity,
so it there's no error, you should be fine. Your content is now on the EEPROM! so it there's no error, you should be fine. Your content is now on the EEPROM!
Why not upload content directly to `0x2000` after having activated `AT28!`? Why not upload content directly to `0x2000` after having activated `AT28!`?