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

shell: rename seek to mptr

going to use `seek` for block devices
This commit is contained in:
Virgil Dupras 2019-04-15 20:42:12 -04:00
parent c996da8ac8
commit a5addc989c
3 changed files with 17 additions and 17 deletions

View File

@ -20,7 +20,7 @@ increase a number at memory address `0xa100`. First, compile it:
Now, we'll send that code to address `0xa000`:
> seek a000
> mptr a000
A000
> load 8 (resulting binary is 8 bytes long)
@ -41,17 +41,17 @@ transfer was successful with:
Good! Now, we can try to run it. Before we run it, let's peek at the value at
`0xa100` (being RAM, it's random):
> seek a100
> mptr a100
A100
> peek
61
So, we'll expect this to become `62` after we run the code. Let's go:
> seek a000
> mptr a000
A000
> call 00 0000
> seek a100
> mptr a100
A100
> peek
62

View File

@ -17,7 +17,7 @@ numerical arguments have to be typed in hexadecimal form, without prefix or
suffix. Lowercase is fine. Single digit is fine for byte (not word) arguments
smaller than `0x10`. Example calls:
seek 01ff
mptr 01ff
peek 4
load 1f
call 00 0123
@ -33,14 +33,14 @@ table describes those codes:
| `02` | Badly formatted arguments |
| `03` | Out of bounds |
## seek
## mptr
The shell has a global memory pointer (let's call it `memptr`) that is used by
other commands. This pointer is 2 bytes long and starts at `0x0000`. To move
it, you use the seek command with the new pointer position. The command
it, you use the mptr command with the new pointer position. The command
prints out the new `memptr` (just to confirm that it has run). Example:
> seek 42ff
> mptr 42ff
42FF
## peek
@ -49,7 +49,7 @@ Read memory targeted by `memptr` and prints its contents in hexadecimal form.
This command takes one byte argument (optional, default to 1), the number of
bytes we want to read. Example:
> seek 0040
> mptr 0040
0040
> peek 2
ED56
@ -83,11 +83,11 @@ return if you don't want to break your system.
The following example works in the case where you've made yourself a jump table
in your glue code a `jp printstr` at `0x0004`:
> seek a000
> mptr a000
A000
> load 6
Hello\0 (you can send a null char through a terminal with CTRL+@)
> seek 0004
> mptr 0004
0004
> call 00 a000
Hello>

View File

@ -42,7 +42,7 @@ SHELL_BUFSIZE .equ 0x20
; *** VARIABLES ***
; Memory address that the shell is currently "pointing at" for peek, load, call
; operations. Set with seek.
; operations. Set with mptr.
SHELL_MEM_PTR .equ SHELL_RAMSTART
; Used to store formatted hex values just before printing it.
SHELL_HEX_FMT .equ SHELL_MEM_PTR+2
@ -330,10 +330,10 @@ shellParseArgs:
;
; Set memory pointer to the specified address (word).
; Example: seek 01fe
shellSeekCmd:
.db "seek", 0b011, 0b001, 0
shellSeek:
; Example: mptr 01fe
shellMptrCmd:
.db "mptr", 0b011, 0b001, 0
shellMptr:
push de
push hl
@ -468,5 +468,5 @@ shellCall:
; This table is at the very end of the file on purpose. The idea is to be able
; to graft extra commands easily after an include in the glue file.
shellCmdTbl:
.dw shellSeekCmd, shellPeekCmd, shellLoadCmd, shellCallCmd
.dw shellMptrCmd, shellPeekCmd, shellLoadCmd, shellCallCmd