-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
603 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,95 @@ | ||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; dump a page of data from the current address | ||
; ----------------------------------------------------------------------------- | ||
dumpCommand: | ||
phx | ||
+outputStringAddr dumpHeader | ||
plx | ||
|
||
ldy #0 | ||
stz TMP_C | ||
|
||
lda CURR_ADDR | ||
and #$f0 | ||
sta DUMP_ROW_START_L | ||
lda CURR_ADDR_H | ||
sta DUMP_ROW_START_H | ||
|
||
;ldx #1 | ||
; cpx COMMAND_LEN | ||
; beq @newLine | ||
;; jsr readHexByte | ||
; jsr hexToAcc | ||
; sta TMP_C | ||
|
||
@newLine | ||
lda #$0d | ||
+outputA | ||
lda #'$' | ||
+outputA | ||
tya | ||
clc | ||
adc CURR_ADDR | ||
sta TEMP_ADDR | ||
lda CURR_ADDR_H | ||
bcc + | ||
inc | ||
sta TEMP_ADDR_H | ||
+ | ||
jsr outHex8 | ||
lda TEMP_ADDR | ||
jsr outHex8 | ||
lda #':' | ||
+outputA | ||
ldx #0 | ||
|
||
@nextByte | ||
lda #' ' | ||
+outputA | ||
lda (CURR_ADDR),y | ||
sta COMMAND_BUFFER,x | ||
inx | ||
jsr outHex8 | ||
iny | ||
cpy TMP_C | ||
beq @doRaw | ||
tya | ||
and #$0f | ||
bne @nextByte | ||
|
||
@doRaw | ||
lda #' ' | ||
+outputA | ||
ldx #0 | ||
- | ||
lda COMMAND_BUFFER,x | ||
cmp #' ' | ||
bcs + | ||
lda #'.' | ||
+ | ||
cmp #'~' | ||
bcc + | ||
lda #'.' | ||
+ | ||
+outputA | ||
inx | ||
cpx #16 | ||
bne - | ||
cpy TMP_C | ||
bne @newLine | ||
|
||
@endDump | ||
lda #$0d | ||
+outputA | ||
jmp commandLoop | ||
|
||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; dump a page of data from the current address | ||
; ----------------------------------------------------------------------------- | ||
dumpCommand: | ||
phx | ||
+outputStringAddr dumpHeader | ||
plx | ||
|
||
ldy #0 | ||
stz TMP_C | ||
|
||
lda CURR_ADDR | ||
and #$f8 | ||
sta DUMP_ROW_START_L | ||
lda CURR_ADDR_H | ||
sta DUMP_ROW_START_H | ||
|
||
ldx #1 | ||
cpx COMMAND_LEN | ||
beq @newLine | ||
jsr readHexByte | ||
jsr hexToAcc | ||
sta TMP_C | ||
|
||
@newLine | ||
lda #$0d | ||
+outputA | ||
lda #'$' | ||
+outputA | ||
tya | ||
clc | ||
adc CURR_ADDR | ||
sta TEMP_ADDR | ||
lda CURR_ADDR_H | ||
bcc + | ||
inc | ||
sta TEMP_ADDR_H | ||
+ | ||
jsr outHex8 | ||
lda TEMP_ADDR | ||
jsr outHex8 | ||
lda #':' | ||
+outputA | ||
ldx #0 | ||
|
||
@nextByte | ||
lda #' ' | ||
+outputA | ||
lda (CURR_ADDR),y | ||
sta COMMAND_BUFFER,x | ||
inx | ||
jsr outHex8 | ||
iny | ||
cpy TMP_C | ||
beq @doRaw | ||
tya | ||
and #$07 | ||
bne @nextByte | ||
|
||
@doRaw | ||
lda #' ' | ||
+outputA | ||
ldx #0 | ||
- | ||
lda COMMAND_BUFFER,x | ||
cmp #' ' | ||
bcs + | ||
lda #'.' | ||
+ | ||
cmp #'~' | ||
bcc + | ||
lda #'.' | ||
+ | ||
+outputA | ||
inx | ||
cpx #8 | ||
bne - | ||
cpy TMP_C | ||
bne @newLine | ||
|
||
@endDump | ||
lda #$0d | ||
+outputA | ||
jmp commandLoop | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; output the help message | ||
; ----------------------------------------------------------------------------- | ||
helpCommand: | ||
+outputStringAddr helpMessage | ||
+outputStringAddr helpMessage2 | ||
jmp commandLoop | ||
|
||
|
||
helpMessage: | ||
!text "HBC-56 - Monitor Help\n\n" | ||
!text " c - clear screen\n" | ||
!text " d [#] - output # bytes from current address\n" | ||
!text " e - execute code from current address\n",0 | ||
helpMessage2: | ||
!text " h - help\n" | ||
!text " q - quit\n" | ||
!text " w <xx>[+] - write value(s) and increment address if +\n" | ||
!text " s <xx> - send value(s) to current address\n" | ||
!text " $ <xxxx> - set current address\n", 0 | ||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; output the help message | ||
; ----------------------------------------------------------------------------- | ||
helpCommand: | ||
+outputStringAddr helpMessage | ||
+outputStringAddr helpMessage2 | ||
jmp commandLoop | ||
|
||
|
||
helpMessage: | ||
!text "HBC-56 - Monitor Help\n\n" | ||
!text " c - clear screen\n" | ||
!text " d [#] - output # bytes from current" | ||
!text " address\n" | ||
!text " e - execute code from current " | ||
!text " address\n",0 | ||
helpMessage2: | ||
!text " h - help\n" | ||
!text " q - quit\n" | ||
!text " w <xx>[+] - write value(s) and\n" | ||
!text " increment address if +\n" | ||
!text " s <xx> - send value(s) to current\n" | ||
!text " address\n" | ||
!text " $ <xxxx> - set current address\n", 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,54 @@ | ||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; write contiguous bytes to a range of addresses | ||
; ----------------------------------------------------------------------------- | ||
writeCommand: | ||
lda CURR_ADDR | ||
sta TEMP_ADDR | ||
lda CURR_ADDR + 1 | ||
sta TEMP_ADDR + 1 | ||
@nextByte | ||
lda #'+' | ||
cmp COMMAND_BUFFER,x | ||
beq @updateCurrent | ||
|
||
jsr readHexByte | ||
|
||
jsr hexToAcc | ||
sta (TEMP_ADDR) | ||
+inc16 TEMP_ADDR | ||
cpx COMMAND_LEN | ||
bcc @nextByte | ||
jmp commandLoop | ||
|
||
@updateCurrent | ||
lda TEMP_ADDR | ||
sta CURR_ADDR | ||
lda TEMP_ADDR + 1 | ||
sta CURR_ADDR + 1 | ||
jmp commandLoop | ||
|
||
|
||
; ----------------------------------------------------------------------------- | ||
; send bytes to a single address (port) | ||
; ----------------------------------------------------------------------------- | ||
sendCommand: | ||
jsr readHexByte | ||
jsr hexToAcc | ||
sta (CURR_ADDR) | ||
cpx COMMAND_LEN | ||
bcc sendCommand | ||
jmp commandLoop | ||
; Troy's HBC-56 - Monitor | ||
; | ||
; Copyright (c) 2022 Troy Schrapel | ||
; | ||
; This code is licensed under the MIT license | ||
; | ||
; https://github.com/visrealm/hbc-56 | ||
; | ||
; | ||
|
||
; ----------------------------------------------------------------------------- | ||
; write contiguous bytes to a range of addresses | ||
; ----------------------------------------------------------------------------- | ||
writeCommand: | ||
lda CURR_ADDR | ||
sta TEMP_ADDR | ||
lda CURR_ADDR + 1 | ||
sta TEMP_ADDR + 1 | ||
@nextByte | ||
lda #'+' | ||
cmp COMMAND_BUFFER,x | ||
beq @updateCurrent | ||
|
||
jsr readHexByte | ||
|
||
jsr hexToAcc | ||
sta (TEMP_ADDR) | ||
+inc16 TEMP_ADDR | ||
cpx COMMAND_LEN | ||
bcc @nextByte | ||
jmp commandLoop | ||
|
||
@updateCurrent | ||
lda TEMP_ADDR | ||
sta CURR_ADDR | ||
lda TEMP_ADDR + 1 | ||
sta CURR_ADDR + 1 | ||
jmp commandLoop | ||
|
||
|
||
; ----------------------------------------------------------------------------- | ||
; send bytes to a single address (port) | ||
; ----------------------------------------------------------------------------- | ||
sendCommand: | ||
php | ||
sei | ||
sendCommandLoop: | ||
jsr readHexByte | ||
jsr hexToAcc | ||
sta (CURR_ADDR) | ||
cpx COMMAND_LEN | ||
bcc sendCommandLoop | ||
plp | ||
jmp commandLoop |
Oops, something went wrong.