1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 09:28:05 +11:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Virgil Dupras
521ff84ca4 Reserve some RAM for future features 2020-04-07 17:32:04 -04:00
Virgil Dupras
71d1350143 emul/hw/rc2014: add memdump command
Why didn't I think of adding it before?
2020-04-07 13:37:52 -04:00
Virgil Dupras
a09e552ccc link: fix literal ASKIP 2020-04-07 11:26:47 -04:00
Virgil Dupras
400f0ab0b0 boot: fix flagsToBC
Why did I ever think that using CM was a good idea? any comparison
with numbers more than 0x8000 apart would be wrong...
2020-04-07 11:26:37 -04:00
11 changed files with 34 additions and 18 deletions

Binary file not shown.

Binary file not shown.

View File

@ -9,3 +9,7 @@ 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,6 +101,13 @@ 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,
CM RETcc, ( > )
CC 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<)
( 51 == SYSTEM SCRATCHPAD )
0x51 _c RAM+ _c @ ( a )
( 60 == SYSTEM SCRATCHPAD )
0x60 _c RAM+ _c @ ( a )
_c DUP _c C@ ( a c )
_c SWAP 1 _c + ( c a+1 )
0x51 _c RAM+ _c ! ( c )
0x60 _c RAM+ _c ! ( c )
;
: BOOT
LIT< (parse) _c (find) _c DROP _c (parse*) _c !
( 51 == SYSTEM SCRATCHPAD )
_c CURRENT _c @ 0x51 _c RAM+ _c !
( 60 == SYSTEM SCRATCHPAD )
_c CURRENT _c @ 0x60 _c RAM+ _c !
( 0c == CINPTR )
LIT< (c<) _c (find) _c DROP 0x0c _c RAM+ _c !
LIT< INIT _c (find)

View File

@ -1,11 +1,13 @@
( depends: cmp
( depends: cmp, parse
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, to copy the
dictionary from '< H@ to CURRENT, and then call RLDICT on
that new range, with "ol" set to ' H@.
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.
)
( Skip atom, considering special atom types. )
@ -21,7 +23,8 @@
( a )
1 + ( we skip by 2, but the loop below is pre-inc... )
BEGIN 1 + DUP C@ NOT UNTIL
( a+1 )
( skip null char )
1 +
;
( Get word header length from wordref. That is, name length
@ -78,6 +81,7 @@
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,8 +247,7 @@ CODE @
E (HL) LDrr,
HL INCss,
D (HL) LDrr,
EXDEHL,
HL PUSHqq,
DE PUSHqq,
;CODE
CODE C!

View File

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

View File

@ -2,3 +2,4 @@
0x71 <>{ 0x70 &= 0x58 |= 0x20 |= <>} NOT #
0x42 <>{ 0x40 &> 0x44 &< <>} #
0x44 <>{ 0x40 &> 0x44 &< <>} NOT #
0x22 0x8065 < #