Getting a good look at the directory, #324
Whammo
started this conversation in
Show and tell
Replies: 2 comments 2 replies
-
Nice! For the imaginary tiny text editor, I should maybe consider adding shadow blocks :-) |
Beta Was this translation helpful? Give feedback.
2 replies
-
Fast compiling. require io
0 value scr
0 value max
$a000 constant target
: calc 1000 scr * target + ;
: sscr 1024 calc 1000 move ;
: blank 53265 dup c@ 239 and swap c! ;
: unblank 53265 dup c@ 16 or swap c! ;
: rdir begin
calc 1024 1000 move scr 48 + 1024 c!
key case
17 of scr max <> if scr 1+ to scr
then endof
145 of scr if scr 1- to scr
then endof
32 of page 0 to scr exit endof
endcase again ;
: ls
parse-name ?dup if else drop s" $"
then 0 0 to scr to max
8 0 open ioabort clrchn
8 chkin ioabort chrin chrin 2drop page
chrin drop blank begin chrin drop
chrin chrin 8 lshift + .
[ w stx, $d020 inc, $d020 dec, here
$ffcf jsr, +branch beq, swap
$ffd2 jsr, jmp, :+ w ldx, ]
$d6 c@ $18 = if sscr
scr 1+ to scr page
target 1024 40 move then
cr chrin 0= until clrchn 8 close
sscr scr to max
0 to scr unblank rdir ; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I always document stuff while it's fresh in my mind.
Forth is just as easy to understand when it's well documented as when it's fresh in your mind.
Beta Was this translation helpful? Give feedback.
All reactions