1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 13:48:05 +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).
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) {
char c;
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
// Stop here
break;

View File

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

View File

@ -196,17 +196,17 @@
( system c< simply reads source from binary, starting at
LATEST. Convenient way to bootstrap a new system. )
: (c<)
( 60 == SYSTEM SCRATCHPAD )
0x60 _c RAM+ _c @ ( a )
( 51 == SYSTEM SCRATCHPAD )
0x51 _c RAM+ _c @ ( a )
_c DUP _c C@ ( a c )
_c SWAP 1 _c + ( c a+1 )
0x60 _c RAM+ _c ! ( c )
0x51 _c RAM+ _c ! ( c )
;
: BOOT
LIT< (parse) _c (find) _c DROP _c (parse*) _c !
( 60 == SYSTEM SCRATCHPAD )
_c CURRENT _c @ 0x60 _c RAM+ _c !
( 51 == SYSTEM SCRATCHPAD )
_c CURRENT _c @ 0x51 _c RAM+ _c !
( 0c == CINPTR )
LIT< (c<) _c (find) _c DROP 0x0c _c RAM+ _c !
LIT< INIT _c (find)

View File

@ -1,13 +1,11 @@
( depends: cmp, parse
( depends: cmp
Relink a dictionary by applying offsets to all word
references in words of the "compiled" type.
A typical usage of this unit would be to, right after a
bootstrap-from-icore-from-source operation, identify the
root word of the source part, probably "H@", and run
" ' thatword COMPACT ". Then, take the resulting relinked
binary, concatenate it to the boot binary, and write to
boot media.
bootstrap-from-icore-from-source operation, to copy the
dictionary from '< H@ to CURRENT, and then call RLDICT on
that new range, with "ol" set to ' H@.
)
( Skip atom, considering special atom types. )
@ -23,8 +21,7 @@
( a )
1 + ( we skip by 2, but the loop below is pre-inc... )
BEGIN 1 + DUP C@ NOT UNTIL
( skip null char )
1 +
( a+1 )
;
( Get word header length from wordref. That is, name length
@ -81,7 +78,6 @@
2OVER ( ol o a2 a1 ol o )
SWAP ( ol o a2 a1 o ol )
RLATOM ( ol o a2 a+n )
2DUP < IF ABORT THEN ( Something is very wrong )
2DUP = ( ol o a2 a+n f )
IF
( unwind )

View File

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

View File

@ -88,9 +88,8 @@ RAMSTART INITIAL_SP
+0e WORDBUF
+2e SYSVNXT
+4e INTJUMP
+51 RESERVED
+60 SYSTEM SCRATCHPAD
+80 RAMEND
+51 SYSTEM SCRATCHPAD
+60 RAMEND
INITIAL_SP holds the initial Stack Pointer value so that we know where to reset
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
project:
* 0x60-0x62: (c<) pointer during in-memory initialization (see below)
* 0x62-0x6a: ACIA buffer pointers in RC2014 recipes.
* 0x51-0x53: (c<) pointer during in-memory initialization (see below)
* 0x53-0x5b: ACIA buffer pointers in RC2014 recipes.
*** Initialization sequence

View File

@ -2,5 +2,5 @@
0xf000 CONSTANT RS_ADDR
0x80 CONSTANT ACIA_CTL
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 #
0x42 <>{ 0x40 &> 0x44 &< <>} #
0x44 <>{ 0x40 &> 0x44 &< <>} NOT #
0x22 0x8065 < #