mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-02 10:20:55 +11:00
Compare commits
4 Commits
1c6e979028
...
521ff84ca4
Author | SHA1 | Date | |
---|---|---|---|
|
521ff84ca4 | ||
|
71d1350143 | ||
|
a09e552ccc | ||
|
400f0ab0b0 |
Binary file not shown.
Binary file not shown.
@ -9,3 +9,7 @@ Run `make` to build.
|
|||||||
|
|
||||||
Run `./classic /path/to/rom` (for example, `os.bin` from RC2014's recipe).
|
Run `./classic /path/to/rom` (for example, `os.bin` from RC2014's recipe).
|
||||||
Serial I/O is hooked to stdin/stdout. `CTRL+D` to quit.
|
Serial I/O is hooked to stdin/stdout. `CTRL+D` to quit.
|
||||||
|
|
||||||
|
## Memory dump
|
||||||
|
|
||||||
|
You can press `CTRL+E` to dump the whole 64K of memory into `memdump`.
|
||||||
|
@ -101,6 +101,13 @@ int main(int argc, char *argv[])
|
|||||||
if (!tosend) {
|
if (!tosend) {
|
||||||
char c;
|
char c;
|
||||||
if (read(fileno(stdin), &c, 1) == 1) {
|
if (read(fileno(stdin), &c, 1) == 1) {
|
||||||
|
if (c == 5) {
|
||||||
|
fprintf(stderr, "Dumping memory to memdump\n");
|
||||||
|
FILE *fp = fopen("memdump", "w");
|
||||||
|
fwrite(m->mem, 0x10000, 1, fp);
|
||||||
|
fclose(fp);
|
||||||
|
c = 0; // don't send to RC2014
|
||||||
|
}
|
||||||
if (c == 4) { // CTRL+D
|
if (c == 4) { // CTRL+D
|
||||||
// Stop here
|
// Stop here
|
||||||
break;
|
break;
|
||||||
|
@ -218,7 +218,7 @@ PC ORG @ 0x29 + ! ( flagsToBC )
|
|||||||
BC 0 LDddnn,
|
BC 0 LDddnn,
|
||||||
CZ RETcc, ( equal )
|
CZ RETcc, ( equal )
|
||||||
BC INCss,
|
BC INCss,
|
||||||
CM RETcc, ( > )
|
CC RETcc, ( > )
|
||||||
( < )
|
( < )
|
||||||
BC DECss,
|
BC DECss,
|
||||||
BC DECss,
|
BC DECss,
|
||||||
|
@ -196,17 +196,17 @@
|
|||||||
( system c< simply reads source from binary, starting at
|
( system c< simply reads source from binary, starting at
|
||||||
LATEST. Convenient way to bootstrap a new system. )
|
LATEST. Convenient way to bootstrap a new system. )
|
||||||
: (c<)
|
: (c<)
|
||||||
( 51 == SYSTEM SCRATCHPAD )
|
( 60 == SYSTEM SCRATCHPAD )
|
||||||
0x51 _c RAM+ _c @ ( a )
|
0x60 _c RAM+ _c @ ( a )
|
||||||
_c DUP _c C@ ( a c )
|
_c DUP _c C@ ( a c )
|
||||||
_c SWAP 1 _c + ( c a+1 )
|
_c SWAP 1 _c + ( c a+1 )
|
||||||
0x51 _c RAM+ _c ! ( c )
|
0x60 _c RAM+ _c ! ( c )
|
||||||
;
|
;
|
||||||
|
|
||||||
: BOOT
|
: BOOT
|
||||||
LIT< (parse) _c (find) _c DROP _c (parse*) _c !
|
LIT< (parse) _c (find) _c DROP _c (parse*) _c !
|
||||||
( 51 == SYSTEM SCRATCHPAD )
|
( 60 == SYSTEM SCRATCHPAD )
|
||||||
_c CURRENT _c @ 0x51 _c RAM+ _c !
|
_c CURRENT _c @ 0x60 _c RAM+ _c !
|
||||||
( 0c == CINPTR )
|
( 0c == CINPTR )
|
||||||
LIT< (c<) _c (find) _c DROP 0x0c _c RAM+ _c !
|
LIT< (c<) _c (find) _c DROP 0x0c _c RAM+ _c !
|
||||||
LIT< INIT _c (find)
|
LIT< INIT _c (find)
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
( depends: cmp
|
( depends: cmp, parse
|
||||||
Relink a dictionary by applying offsets to all word
|
Relink a dictionary by applying offsets to all word
|
||||||
references in words of the "compiled" type.
|
references in words of the "compiled" type.
|
||||||
|
|
||||||
A typical usage of this unit would be to, right after a
|
A typical usage of this unit would be to, right after a
|
||||||
bootstrap-from-icore-from-source operation, to copy the
|
bootstrap-from-icore-from-source operation, identify the
|
||||||
dictionary from '< H@ to CURRENT, and then call RLDICT on
|
root word of the source part, probably "H@", and run
|
||||||
that new range, with "ol" set to ' H@.
|
" ' thatword COMPACT ". Then, take the resulting relinked
|
||||||
|
binary, concatenate it to the boot binary, and write to
|
||||||
|
boot media.
|
||||||
)
|
)
|
||||||
|
|
||||||
( Skip atom, considering special atom types. )
|
( Skip atom, considering special atom types. )
|
||||||
@ -21,7 +23,8 @@
|
|||||||
( a )
|
( a )
|
||||||
1 + ( we skip by 2, but the loop below is pre-inc... )
|
1 + ( we skip by 2, but the loop below is pre-inc... )
|
||||||
BEGIN 1 + DUP C@ NOT UNTIL
|
BEGIN 1 + DUP C@ NOT UNTIL
|
||||||
( a+1 )
|
( skip null char )
|
||||||
|
1 +
|
||||||
;
|
;
|
||||||
|
|
||||||
( Get word header length from wordref. That is, name length
|
( Get word header length from wordref. That is, name length
|
||||||
@ -78,6 +81,7 @@
|
|||||||
2OVER ( ol o a2 a1 ol o )
|
2OVER ( ol o a2 a1 ol o )
|
||||||
SWAP ( ol o a2 a1 o ol )
|
SWAP ( ol o a2 a1 o ol )
|
||||||
RLATOM ( ol o a2 a+n )
|
RLATOM ( ol o a2 a+n )
|
||||||
|
2DUP < IF ABORT THEN ( Something is very wrong )
|
||||||
2DUP = ( ol o a2 a+n f )
|
2DUP = ( ol o a2 a+n f )
|
||||||
IF
|
IF
|
||||||
( unwind )
|
( unwind )
|
||||||
|
@ -247,8 +247,7 @@ CODE @
|
|||||||
E (HL) LDrr,
|
E (HL) LDrr,
|
||||||
HL INCss,
|
HL INCss,
|
||||||
D (HL) LDrr,
|
D (HL) LDrr,
|
||||||
EXDEHL,
|
DE PUSHqq,
|
||||||
HL PUSHqq,
|
|
||||||
;CODE
|
;CODE
|
||||||
|
|
||||||
CODE C!
|
CODE C!
|
||||||
|
@ -88,8 +88,9 @@ RAMSTART INITIAL_SP
|
|||||||
+0e WORDBUF
|
+0e WORDBUF
|
||||||
+2e SYSVNXT
|
+2e SYSVNXT
|
||||||
+4e INTJUMP
|
+4e INTJUMP
|
||||||
+51 SYSTEM SCRATCHPAD
|
+51 RESERVED
|
||||||
+60 RAMEND
|
+60 SYSTEM SCRATCHPAD
|
||||||
|
+80 RAMEND
|
||||||
|
|
||||||
INITIAL_SP holds the initial Stack Pointer value so that we know where to reset
|
INITIAL_SP holds the initial Stack Pointer value so that we know where to reset
|
||||||
it on ABORT
|
it on ABORT
|
||||||
@ -119,8 +120,8 @@ SYSTEM SCRATCHPAD is reserved for temporary system storage or can be reserved
|
|||||||
by low-level drivers. These are the current usages of this space throughout the
|
by low-level drivers. These are the current usages of this space throughout the
|
||||||
project:
|
project:
|
||||||
|
|
||||||
* 0x51-0x53: (c<) pointer during in-memory initialization (see below)
|
* 0x60-0x62: (c<) pointer during in-memory initialization (see below)
|
||||||
* 0x53-0x5b: ACIA buffer pointers in RC2014 recipes.
|
* 0x62-0x6a: ACIA buffer pointers in RC2014 recipes.
|
||||||
|
|
||||||
*** Initialization sequence
|
*** Initialization sequence
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
0xf000 CONSTANT RS_ADDR
|
0xf000 CONSTANT RS_ADDR
|
||||||
0x80 CONSTANT ACIA_CTL
|
0x80 CONSTANT ACIA_CTL
|
||||||
0x81 CONSTANT ACIA_IO
|
0x81 CONSTANT ACIA_IO
|
||||||
RAMSTART 0x53 + CONSTANT ACIA_MEM
|
RAMSTART 0x62 + CONSTANT ACIA_MEM
|
||||||
|
|
||||||
|
@ -2,3 +2,4 @@
|
|||||||
0x71 <>{ 0x70 &= 0x58 |= 0x20 |= <>} NOT #
|
0x71 <>{ 0x70 &= 0x58 |= 0x20 |= <>} NOT #
|
||||||
0x42 <>{ 0x40 &> 0x44 &< <>} #
|
0x42 <>{ 0x40 &> 0x44 &< <>} #
|
||||||
0x44 <>{ 0x40 &> 0x44 &< <>} NOT #
|
0x44 <>{ 0x40 &> 0x44 &< <>} NOT #
|
||||||
|
0x22 0x8065 < #
|
||||||
|
Loading…
Reference in New Issue
Block a user