Tab reaches the disk
Paths and programs, which is the half that makes it worth having. The first word of a line is a command or a PROGRAM, offered under the name somebody would type - the extension taken off - and anything after it is a file, offered as it really is. A separator anywhere in the word says which directory to look in. A directory answers with a separator on the end instead of a space, which says what it is and lets the next part be typed straight away. The answer ending in one is also what stops a space being added, so that is one test rather than a flag. PROGRAMS ARE LOOKED FOR WHERE THE SHELL WOULD LOOK to run one: where you are, /Apps on the disk you are on, and /Apps on drive 0. Offering something the shell would not find would be finishing a word into a thing that then does not work. Drive 0's is skipped when that is already the drive, or every program in it would be offered twice and nothing would ever be the only match. Walking somebody else's directory means standing in it, which is the only way to walk one here, so where the person was and which drive they were on are put down first and restored whatever happens. Three bugs, all found by running it: THE DIRECTORY TEST WAS INVERTED. dir asks the same question the same way round four hundred lines further up, which is what made it obvious once looked at. THE /Apps WALK OVERWROTE THE TYPED PATH. The whole search runs a second time to list the matches, and by then TabDir said "/Apps" - so a word that had named nowhere went looking in the wrong place and listed nothing at all. Two ways into the walk now, and the typed path is never written over. AND LISTING ONLY KNEW ABOUT COMMANDS, because it was a second copy of the walk. It is the same walk with a flag now: finding the answer and showing the matches are the same question asked twice. Also cosmosMonitor, which had been RE-BLESSED INTO MEANINGLESSNESS by the wall move. It disassembles a loaded program, at an address the input names - and that address moved a page while the recording was simply re-recorded to whatever came out, which was a page of zeroes. It is pointed at 5000 again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
bb065fe221
commit
3c76934a9a
@@ -9,27 +9,27 @@ there is no such bank
|
||||
loaded, starting at 5000
|
||||
* b program
|
||||
bank 00
|
||||
* d 4000
|
||||
4000 00 ?
|
||||
4001 00 ?
|
||||
4002 00 ?
|
||||
4003 00 ?
|
||||
4004 00 ?
|
||||
4005 00 ?
|
||||
4006 00 ?
|
||||
4007 00 ?
|
||||
* x 4000
|
||||
4000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
4010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
4020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
4030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
* d 5000
|
||||
5000 47 00 30 00 SETD.0 3000
|
||||
5004 72 10 SWI 10
|
||||
5006 47 00 30 44 SETD.0 3044
|
||||
500A 72 10 SWI 10
|
||||
500C 47 00 30 7A SETD.0 307A
|
||||
5010 27 1F INIB 1F
|
||||
5012 72 11 SWI 11
|
||||
5014 47 00 30 5D SETD.0 305D
|
||||
* x 5000
|
||||
5000 47 00 30 00 72 10 47 00 30 44 72 10 47 00 30 7A G.0.r.G.0Dr.G.0z
|
||||
5010 27 1F 72 11 47 00 30 5D 72 10 47 00 30 7A 72 10 '.r.G.0]r.G.0zr.
|
||||
5020 47 00 30 65 72 10 20 72 12 00 00 00 00 00 00 00 G.0er. r........
|
||||
5030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
* b data
|
||||
bank 01
|
||||
* x 2000
|
||||
2000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
2010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
2020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
2030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
|
||||
* x 3000
|
||||
3000 61 20 70 72 6F 67 72 61 6D 2C 20 6C 6F 61 64 65 a program, loade
|
||||
3010 64 20 6F 66 66 20 61 20 64 69 73 6B 2C 20 72 75 d off a disk, ru
|
||||
3020 6E 6E 69 6E 67 20 6F 6E 20 74 68 65 20 73 79 73 nning on the sys
|
||||
3030 74 65 6D 20 74 68 61 74 20 6C 6F 61 64 65 64 20 tem that loaded
|
||||
* b 2
|
||||
bank 02
|
||||
* x 0
|
||||
|
||||
@@ -10,24 +10,10 @@ dir do drive delete
|
||||
I do not know: d
|
||||
> zzzx
|
||||
I do not know: zzzx
|
||||
> echo here
|
||||
here
|
||||
> help [15;3Hhelp [15;8H
|
||||
dir list what is on the disk
|
||||
load <file> read a program off the disk
|
||||
run [words] start what was loaded, and tell it those words
|
||||
<name> [words] look where you are and then in /Apps, and start that
|
||||
cd [path] go to a directory, or to the root with nothing after it
|
||||
mkdir <path> make a directory
|
||||
rmdir <path> remove an empty one
|
||||
do <file> run the lines in a file, which must start with #!
|
||||
echo [words] say them
|
||||
clear empty the screen
|
||||
delete <file> take it off the disk
|
||||
rename <file> <to> call it something else
|
||||
monitor look at memory, change it, and jump into it
|
||||
help this
|
||||
exit stop, or leave the monitor if you are in it
|
||||
> echo he[13;3Hecho hello.sbx [13;18Hre
|
||||
hello.sbx re
|
||||
> help [15;3Hhel[15;6H
|
||||
I do not know: hel
|
||||
> exit
|
||||
halted
|
||||
Execution halted.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
CosmOS
|
||||
> Cr[2;3HCrash [2;9Hzz
|
||||
Crash opcode | service | bank | device | blind
|
||||
finished
|
||||
> Sa[5;3HSay[5;6Hzz
|
||||
I do not know: Sayzz
|
||||
> cd Ap[7;3Hcd Apps/[7;11H
|
||||
/Apps> echo where am I
|
||||
where am I
|
||||
/Apps> cd /
|
||||
> echo Apps/S[11;3Hecho Apps/Say.sbx [11;21H
|
||||
Apps/Say.sbx
|
||||
> echo /Apps/C[13;3Hecho /Apps/Copy.sbx [13;23H
|
||||
/Apps/Copy.sbx
|
||||
> exit
|
||||
halted
|
||||
Execution halted.
|
||||
[exit 0]
|
||||
@@ -3,10 +3,10 @@ b nonsense
|
||||
b 9
|
||||
load greet.sbx
|
||||
b program
|
||||
d 4000
|
||||
x 4000
|
||||
d 5000
|
||||
x 5000
|
||||
b data
|
||||
x 2000
|
||||
x 3000
|
||||
b 2
|
||||
x 0
|
||||
s 0 FF
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Cr zz
|
||||
Sa zz
|
||||
cd Ap
|
||||
echo where am I
|
||||
cd /
|
||||
echo Apps/S
|
||||
echo /Apps/C
|
||||
exit
|
||||
@@ -389,6 +389,17 @@ cosmosHistory | CosmOS/Source/cosmos.asm | run | cosmosHis
|
||||
# The last line is the one that says it works on what is actually there rather than on what
|
||||
# was typed: two backspaces take "help" down to "he", and Tab finishes it again.
|
||||
cosmosTab | CosmOS/Source/cosmos.asm | run | cosmosTab.in | - | disks/cosmos.img
|
||||
# And the half of it that reaches the disk. A program is offered under the name somebody
|
||||
# would type - the extension taken off - because that is what a first word can usefully be;
|
||||
# anywhere after the first word everything is offered as it really is. A directory answers
|
||||
# with a separator rather than a space, which says what it is and lets the next part be
|
||||
# typed straight away.
|
||||
#
|
||||
# A path in the word says where to look, and the shell looks in the three places it would
|
||||
# look to RUN something: where you are, /Apps on the disk you are on, and /Apps on drive 0.
|
||||
# Offering what the shell would not find would be finishing a word into something that then
|
||||
# does not work.
|
||||
cosmosTabPath | CosmOS/Source/cosmos.asm | run | cosmosTabPath.in | - | disks/cosmos.img
|
||||
# The same editing offered to a PROGRAM, through osReadLine. Edit reads its lines that way,
|
||||
# so a word typed with two letters the wrong way round is put right without starting the line
|
||||
# again - which is the whole of what A4 buys.
|
||||
|
||||
Reference in New Issue
Block a user