1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 04: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
5 Number literals 6 Compilation vs meta-comp.
4 Number literals 6 Compilation vs meta-comp.
8 Interpreter I/O 11 Signed-ness
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, ;
0xf3 OP1 DI, 0xfb OP1 EI,
0xeb OP1 EXDEHL, 0xd9 OP1 EXX,
0x08 OP1 EXAFAF',
0x76 OP1 HALT, 0xe9 OP1 JP(HL),
0x12 OP1 LD(DE)A, 0x1a OP1 LDA(DE),
0x02 OP1 LD(BC)A, 0x0a OP1 LDA(BC),
0x00 OP1 NOP, 0xc9 OP1 RET,
0x17 OP1 RLA, 0x07 OP1 RLCA,
0x1f OP1 RRA, 0x0f OP1 RRCA,

View File

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

View File

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

11
blk/299
View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
CODE PC!
BC POPqq,
HL POPqq,
chkPS,
L OUT(C)r,
;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
The binary from the base recipe has almost all it needs to write to EEPROM. The
only thing it needs is the AT28 driver from B590. You could add it to the
`xcomp` unit and rebuild, but the driver is so tiny, you're probably better off
loading it at runtime.
You build the binary by modifying the base recipe's `xcomp` unit. This binary
is missing 2 things: Addressed devices and the AT28 Driver.
If your system has mass storage, it's as easy as a LOAD. If it doesn't, you
can use `/tools/exec` to send `blk/591` to the RC2014.
Addressed devices are at B140. If you read that block, you'll see that it tells
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
@ -52,7 +58,7 @@ run this from your modern computer:
./upload <tty device> a000 <filename>
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!
Why not upload content directly to `0x2000` after having activated `AT28!`?