Browse Source

Merge pull request #238 from b1ackmai1er/dev

dbgmon enhancements
pull/246/head
Wayne Warthen 4 years ago
committed by GitHub
parent
commit
4f9a63349c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 66
      Source/Doc/ROM_Applications.md
  2. 49
      Source/HBIOS/dbgmon.asm

66
Source/Doc/ROM_Applications.md

@ -45,33 +45,54 @@ for testing and programming. It allows programs to be entered,
memory to be examined, and input/output devices to be read or
written to.
It's key advantage is that is available at boot up.
It's key advantage is that is available at boot up.
Its key disadvantages are that code cannot be entered in assembly language
and there is no ability to save to memory devices.
The available memory are for programming is `0200-EDFFh`. The following areas are reserved:
Memory Area | Function
------------|-----------------------------------
`0000-00FFh`| Jump and restart (RST) vectors
`0100-01FFh`| HBIOS configuration block
`FE00-FFFFh`| HBIOS proxy
Commands can be entered at the command prompt `>`
Automatic case conversion takes place on command entry and all arguments are expected to be in hex format.
The current memory bank in low memory is displayed before the prompt i.e.:
`8E>`
Refer to the RomWBW Architecture manual for details memory banking.
A quick guide to using the Monitor program follows:
## ? - Displays a summary of available commands.
```
Monitor Commands (all values in hex):`
B - Boot system`
D xxxx yyyy - Dump memory from xxxx to yyyy`
F xxxx yyyy zz - Fill memory from xxxx to yyyy with zz`
H - Halt system`
I xxxx - Input from port xxxx`
K - Keyboard echo`
L - Load Intel hex data`
M xxxx yyyy zzzz - Move memory block xxxx-yyyy to zzzz`
O xxxx yy - Output value yy to port xxxx`
P xxxx - Program RAM at address xxxx`
R xxxx - Run code at address xxxx`
S xx - Set bank to xx`
X - Exit monitor`
Monitor Commands (all values in hex):
B - Boot system
D xxxx yyyy - Dump memory from xxxx to yyyy
F xxxx yyyy zz - Fill memory from xxxx to yyyy with zz
H - Halt system
I xxxx - Input from port xxxx
K - Keyboard echo
L - Load Intel hex data
M xxxx yyyy zzzz - Move memory block xxxx-yyyy to zzzz
O xxxx yy - Output value yy to port xxxx
P xxxx - Program RAM at address xxxx
R xxxx [[yy] [zzzz]] - Run code at address xxxx
Pass yy and zzzz to register A and BC
S xx - Set bank to xx
X - Exit monitor
```
## Cold Boot
B - Performs a cold boot of the ROMWBW system. A complete
reinitialization of the system is performed and the system
re-initialization of the system is performed and the system
returns to the Boot Loader prompt.
## Dump Memory
@ -160,10 +181,19 @@ Use clip leaded LEDs to confirm the data written.
## Program memory location
P xxxx - Program memory location xxxx. This routine will
allow you to program a hexidecimal into memory starting
allow you to program a hexadecimal into memory starting
at location xxxx. Press 'Enter' on a blank line to
return to the Monitor prompt.
## Run program
R xxxx [[yy] [zzzz]] - Run program at location xxxx. if optional
arguments yy and zzzz are entered they are loaded into the
A and BC register respectively. The return address of the
Monitor is saved on the stack so the program can return
to the monitor. On return to the monitor, the contents of
the A, HL, DE and BC registers are displayed.
## NOTES:
The Monitor allows access to all memory locations. ROM and
@ -187,4 +217,4 @@ and then run RTC to see the options list.
# Network Boot
# ZModem Flash Update
# ZModem Flash Update

49
Source/HBIOS/dbgmon.asm

@ -5,7 +5,7 @@
; MODIFIED BY : DAN WERNER 03 09.2009
;
;__REFERENCES_________________________________________________________________
; THOMAS SCHERRER BASIC HAR.DWARE TEST ASSEMBLER SOURCES FROM THE Z80 INFO PAGE
; THOMAS SCHERRER BASIC HARDWARE TEST ASSEMBLER SOURCES FROM THE Z80 INFO PAGE
; INCLUDING ORIGINAL SCHEMATIC CONCEPT
; HTTP://Z80.INFO/Z80SOURC.TXT
; CODE SAMPLES FROM BRUCE JONES PUBLIC DOMAIN ROM MONITOR FOR THE SBC-200C
@ -76,8 +76,8 @@ SERIALCMDLOOP:
LD SP,MON_STACK ; RESET STACK
CALL NEWLINE
#IF (BIOS == BIOS_WBW)
LD A,($FFE0)
CALL PRTHEXBYTE
LD A,($FFE0) ; DISPLAY CURRENTLY ACTIVE
CALL PRTHEXBYTE ; BANK IN LOW MEMORY
#ENDIF
LD A,'>'
CALL COUT
@ -223,19 +223,44 @@ SETBNK:
;__RUN________________________________________________________________________
;
; TRANSFER OUT OF MONITOR, USER OPTION "R"
; SYNTAX: R <ADDR>
; SYNTAX: R <ADDR> [<A-VALUE> [<BC-VALUE>]]
;_____________________________________________________________________________
;
RUN:
CALL WORDPARM ; GET START ADDRESS
JP C,ERR ; HANDLE ERRORS
PUSH DE ; SAVE VALUE
CALL BYTEPARM ; GET OPTIONAL
PUSH AF ; A REGISTER VALUE
CALL WORDPARM ; GET OPTIONAL
PUSH DE ; BC REGISTER VALUE
CALL NONBLANK ; LOOK FOR EXTRANEOUS PARAMETERS
CP 0 ; TEST FOR TERMINATING NULL
JP NZ,ERR ; ERROR IF NOT TERMINATING NULL
POP BC ; RECOVER BC REGISTER VALUE TO PASS
POP AF ; RECOVER A REGISTER VALUE TO PASS
POP HL ; RECOVER START ADDRESS
;
LD DE,PREG1 ; SETUP A RETURN
PUSH DE ; ADDRESS
;
JP (HL) ; GO
;
PREG1: PUSH BC ; SAVE
PUSH DE ; REGISTERS
PUSH HL ; FOR DISPLAY
;
CALL NEWLINE
CALL PRTHEXBYTE ; DISPLAY A
CALL PC_SPACE ; REGISTER
;
LD B,3
PREG2: POP HL ; DISPLAY
CALL PHL ; HL DE BC
CALL PC_SPACE ; REGISTER
DJNZ PREG2
JP SERIALCMDLOOP
;
;__PROGRM_____________________________________________________________________
;
; PROGRAM RAM LOCATIONS, USER OPTION "P"
@ -253,11 +278,16 @@ PROGRM1:
POP HL
PUSH HL
CALL PHL
CALL PC_COLON
CALL PC_COLON ; DISPLAY
CALL PC_SPACE ; CURRENT
POP HL ; VALUE
PUSH HL
LD A,(HL)
CALL PRTHEXBYTE
CALL PC_SPACE
LD HL,KEYBUF
CALL GETLN
LD HL,KEYBUF
LD HL,KEYBUF ; GET AND
CALL GETLN ; SAVE NEW
LD HL,KEYBUF ; VALUE
CALL NONBLANK
CP 0
JP Z,SERIALCMDLOOP
@ -983,7 +1013,8 @@ TXT_HELP .TEXT "\r\nMonitor Commands (all values in hex):"
.TEXT "\r\nM xxxx yyyy zzzz - Move memory block xxxx-yyyy to zzzz"
.TEXT "\r\nO xxxx yy - Output value yy to port xxxx"
.TEXT "\r\nP xxxx - Program RAM at address xxxx"
.TEXT "\r\nR xxxx - Run code at address xxxx"
.TEXT "\r\nR xxxx [[yy] [zzzz]] - Run code at address xxxx"
.TEXT "\r\n Pass yy and zzzz to register A and BC"
.TEXT "\r\nS xx - Set bank to xx"
.TEXT "\r\nX - Exit monitor"
.TEXT "$"

Loading…
Cancel
Save