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

Compare commits

..

No commits in common. "521ff84ca4b6d9dbe07b08716ec2cf763626cf6a" and "1c6e979028846e83ad273027a1a63950e1f31002" have entirely different histories.

11 changed files with 18 additions and 34 deletions

Binary file not shown.

Binary file not shown.

View File

@ -9,7 +9,3 @@ 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`.

View File

@ -101,13 +101,6 @@ 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;

View File

@ -218,7 +218,7 @@ PC ORG @ 0x29 + ! ( flagsToBC )
BC 0 LDddnn, BC 0 LDddnn,
CZ RETcc, ( equal ) CZ RETcc, ( equal )
BC INCss, BC INCss,
CC RETcc, ( > ) CM RETcc, ( > )
( < ) ( < )
BC DECss, BC DECss,
BC DECss, BC DECss,

View File

@ -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<)
( 60 == SYSTEM SCRATCHPAD ) ( 51 == SYSTEM SCRATCHPAD )
0x60 _c RAM+ _c @ ( a ) 0x51 _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 )
0x60 _c RAM+ _c ! ( c ) 0x51 _c RAM+ _c ! ( c )
; ;
: BOOT : BOOT
LIT< (parse) _c (find) _c DROP _c (parse*) _c ! LIT< (parse) _c (find) _c DROP _c (parse*) _c !
( 60 == SYSTEM SCRATCHPAD ) ( 51 == SYSTEM SCRATCHPAD )
_c CURRENT _c @ 0x60 _c RAM+ _c ! _c CURRENT _c @ 0x51 _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)

View File

@ -1,13 +1,11 @@
( depends: cmp, parse ( depends: cmp
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, identify the bootstrap-from-icore-from-source operation, to copy the
root word of the source part, probably "H@", and run dictionary from '< H@ to CURRENT, and then call RLDICT on
" ' thatword COMPACT ". Then, take the resulting relinked that new range, with "ol" set to ' H@.
binary, concatenate it to the boot binary, and write to
boot media.
) )
( Skip atom, considering special atom types. ) ( Skip atom, considering special atom types. )
@ -23,8 +21,7 @@
( 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
( skip null char ) ( a+1 )
1 +
; ;
( Get word header length from wordref. That is, name length ( Get word header length from wordref. That is, name length
@ -81,7 +78,6 @@
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 )

View File

@ -247,7 +247,8 @@ CODE @
E (HL) LDrr, E (HL) LDrr,
HL INCss, HL INCss,
D (HL) LDrr, D (HL) LDrr,
DE PUSHqq, EXDEHL,
HL PUSHqq,
;CODE ;CODE
CODE C! CODE C!

View File

@ -88,9 +88,8 @@ RAMSTART INITIAL_SP
+0e WORDBUF +0e WORDBUF
+2e SYSVNXT +2e SYSVNXT
+4e INTJUMP +4e INTJUMP
+51 RESERVED +51 SYSTEM SCRATCHPAD
+60 SYSTEM SCRATCHPAD +60 RAMEND
+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
@ -120,8 +119,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:
* 0x60-0x62: (c<) pointer during in-memory initialization (see below) * 0x51-0x53: (c<) pointer during in-memory initialization (see below)
* 0x62-0x6a: ACIA buffer pointers in RC2014 recipes. * 0x53-0x5b: ACIA buffer pointers in RC2014 recipes.
*** Initialization sequence *** Initialization sequence

View File

@ -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 0x62 + CONSTANT ACIA_MEM RAMSTART 0x53 + CONSTANT ACIA_MEM

View File

@ -2,4 +2,3 @@
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 < #