mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-02 08:20:57 +11:00
Compare commits
No commits in common. "792c7816140ab1ddf4e6308f9ade76e54eba7dc3" and "65f359bda4c8eedf1a3ad9cf0c98f2df2e5b5274" have entirely different histories.
792c781614
...
65f359bda4
2
blk/102
2
blk/102
@ -1,5 +1,5 @@
|
||||
152 LOAD ( extras )
|
||||
103 106 LOADR
|
||||
103 105 LOADR
|
||||
|
||||
: BROWSE
|
||||
100 _LIST
|
||||
|
27
blk/104
27
blk/104
@ -1,13 +1,16 @@
|
||||
( Cursor position in buffer. EDPOS/64 is line number )
|
||||
( Line numbers for the user are 1-based, but in code, they're
|
||||
0-based. )
|
||||
VARIABLE EDPOS
|
||||
: _cpos BLK( + ;
|
||||
: _lpos 64 * _cpos ;
|
||||
: _pln ( lineno -- )
|
||||
DUP _lpos DUP 64 + SWAP DO ( lno )
|
||||
I EDPOS @ _cpos = IF '^' EMIT THEN
|
||||
I C@ DUP 0x20 < IF DROP 0x20 THEN
|
||||
EMIT
|
||||
LOOP ( lno )
|
||||
1+ . ;
|
||||
( user-facing lines are 1-based )
|
||||
: T 1- DUP 64 * EDPOS ! _pln ;
|
||||
: _bpos 64 * BLK( + ;
|
||||
: T 1- DUP EDPOS ! _bpos (print) CRLF ;
|
||||
: P
|
||||
EDPOS @ _bpos C<
|
||||
64 0 DO ( bpos c )
|
||||
DUP 0xd = IF DROP 0 THEN
|
||||
2DUP SWAP I + C!
|
||||
DUP IF DROP C< THEN
|
||||
LOOP
|
||||
2DROP
|
||||
BLK!!
|
||||
;
|
||||
|
||||
|
19
blk/105
19
blk/105
@ -1,16 +1,11 @@
|
||||
: P
|
||||
EDPOS @ _cpos C<
|
||||
64 0 DO ( bpos c )
|
||||
DUP 0xd = IF DROP 0 THEN
|
||||
2DUP SWAP I + C!
|
||||
DUP IF DROP C< THEN
|
||||
LOOP
|
||||
2DROP
|
||||
BLK!!
|
||||
;
|
||||
|
||||
: _mvln+ ( ln -- move ln 1 line further )
|
||||
DUP 14 > IF DROP EXIT THEN
|
||||
_lpos DUP 64 + 64 MOVE
|
||||
_bpos DUP 64 + 64 MOVE
|
||||
;
|
||||
|
||||
: U
|
||||
15 EDPOS @ - 0 DO
|
||||
14 I - _mvln+
|
||||
LOOP
|
||||
P
|
||||
;
|
||||
|
2
blk/490
2
blk/490
@ -5,4 +5,4 @@ moment, they are thin layer over the drivers provided by
|
||||
TRSDOS' SVC.
|
||||
|
||||
Load the Z80 words with "492 LOAD" and the high level part
|
||||
with "498 LOAD".
|
||||
with "494 LOAD".
|
||||
|
17
blk/492
17
blk/492
@ -1 +1,16 @@
|
||||
493 496 LOADR
|
||||
CODE KEY
|
||||
A 0x01 LDrn, ( @KEY )
|
||||
0x28 RSTn,
|
||||
L A LDrr, H 0 LDrn,
|
||||
HL PUSHqq,
|
||||
;CODE
|
||||
CODE EMIT
|
||||
BC POPqq, ( c == @DSP arg )
|
||||
chkPS,
|
||||
A 0x02 LDrn, ( @DSP )
|
||||
0x28 RSTn,
|
||||
;CODE
|
||||
CODE BYE
|
||||
HL 0 LDddnn,
|
||||
A 0x16 LDrn, ( @EXIT )
|
||||
0x28 RSTn,
|
||||
|
16
blk/493
16
blk/493
@ -1,16 +0,0 @@
|
||||
CODE KEY
|
||||
A 0x01 LDrn, ( @KEY )
|
||||
0x28 RSTn,
|
||||
L A LDrr, H 0 LDrn,
|
||||
HL PUSHqq,
|
||||
;CODE
|
||||
CODE EMIT
|
||||
BC POPqq, ( c == @DSP arg )
|
||||
chkPS,
|
||||
A 0x02 LDrn, ( @DSP )
|
||||
0x28 RSTn,
|
||||
;CODE
|
||||
CODE BYE
|
||||
HL 0 LDddnn,
|
||||
A 0x16 LDrn, ( @EXIT )
|
||||
0x28 RSTn,
|
7
blk/494
7
blk/494
@ -1,7 +0,0 @@
|
||||
CODE DCSTAT ( drv -- f )
|
||||
BC POPqq,
|
||||
chkPS,
|
||||
A 0x28 LDrn, ( @DCSTAT )
|
||||
0x28 RSTn,
|
||||
PUSHZ,
|
||||
;CODE
|
10
blk/495
10
blk/495
@ -1,10 +0,0 @@
|
||||
CODE RDSEC ( drv cylsec addr -- f )
|
||||
HL POPqq,
|
||||
DE POPqq,
|
||||
BC POPqq,
|
||||
chkPS,
|
||||
A 0x31 LDrn, ( @RDSEC )
|
||||
0x28 RSTn,
|
||||
PUSHZ,
|
||||
;CODE
|
||||
|
11
blk/496
11
blk/496
@ -1,11 +0,0 @@
|
||||
CODE WRSEC ( drv cylsec addr -- f )
|
||||
HL POPqq,
|
||||
DE POPqq,
|
||||
BC POPqq,
|
||||
chkPS,
|
||||
A 0x35 LDrn, ( @WRSEC )
|
||||
0x28 RSTn,
|
||||
PUSHZ,
|
||||
;CODE
|
||||
|
||||
|
16
blk/499
16
blk/499
@ -1,16 +0,0 @@
|
||||
: _err ABORT" FDerr" ;
|
||||
: _cylsec ( sec -- cs, return sector/cylinder for given secid )
|
||||
( 4 256b sectors per block, 10 sec per cyl, 40 cyl max )
|
||||
10 /MOD ( sec cyl )
|
||||
DUP 39 > IF _err THEN
|
||||
256 * + ( cylsec )
|
||||
;
|
||||
: FD@! ( wref blk -- )
|
||||
1 DCSTAT NOT IF _err THEN
|
||||
4 * ( wr sec )
|
||||
4 0 DO ( wr sec )
|
||||
DUP I + _cylsec ( wr sec cs )
|
||||
I 256 * BLK( + ( wr sec cs addr )
|
||||
1 ROT ROT ( wr sec drv cs addr )
|
||||
4 PICK EXECUTE NOT IF _err THEN
|
||||
LOOP 2DROP ;
|
4
blk/500
4
blk/500
@ -1,4 +0,0 @@
|
||||
: FD@ ['] RDSEC SWAP FD@! ;
|
||||
: FD! ['] WRSEC SWAP FD@! ;
|
||||
: FD$ ['] FD@ BLK@* ! ['] FD! BLK!* ! ;
|
||||
|
@ -18,7 +18,6 @@ H@ 256 /MOD 2 PC! 2 PC!
|
||||
( Update LATEST )
|
||||
PC ORG @ 8 + !
|
||||
," CURRENT @ HERE ! "
|
||||
422 470 XPACKR ( core cmp print parse readln fmt blk )
|
||||
499 500 XPACKR ( trs80.fs )
|
||||
," : _ BLK$ FD$ (ok) RDLN$ ; _ "
|
||||
422 463 XPACKR ( core cmp print parse readln fmt )
|
||||
," : _ RDLN$ (ok) ; _ "
|
||||
H@ 256 /MOD 2 PC! 2 PC!
|
||||
|
Loading…
Reference in New Issue
Block a user