Skip to content

Commit

Permalink
Heath H8 Panel Tweaks
Browse files Browse the repository at this point in the history
- Notify HBIOS of speed changes (keeps HBIOS in sync with panel)
- Correct display for HL, SP, and PC registers.
  • Loading branch information
wwarthen committed Sep 14, 2024
1 parent df28567 commit e376e55
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 28 deletions.
1 change: 1 addition & 0 deletions Source/Apps/Test/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pushd piomon && call Build || exit /b & popd
pushd banktest && call Build || exit /b & popd
pushd portscan && call Build || exit /b & popd
pushd sound && call Build || exit /b & popd
pushd testh8p && call Build || exit /b & popd

goto :eof

Expand Down
1 change: 1 addition & 0 deletions Source/Apps/Test/Clean.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ pushd piomon && call Clean || exit /b 1 & popd
pushd banktest && call Clean || exit /b 1 & popd
pushd portscan && call Clean || exit /b 1 & popd
pushd sound && call Clean || exit /b 1 & popd
pushd testh8p && call Clean || exit /b 1 & popd
2 changes: 1 addition & 1 deletion Source/Apps/Test/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OBJECTS =
SUBDIRS = DMAmon I2C inttest ppidetst ramtest tstdskng rzsz vdctest kbdtest ps2info 2piotst piomon banktest portscan sound
SUBDIRS = DMAmon I2C inttest ppidetst ramtest tstdskng rzsz vdctest kbdtest ps2info 2piotst piomon banktest portscan sound testh8p
DEST = ../../../Binary/Apps/Test
TOOLS =../../../Tools

Expand Down
10 changes: 10 additions & 0 deletions Source/Apps/Test/testh8p/Build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@echo off
setlocal

set TOOLS=../../../../Tools
set PATH=%TOOLS%\tasm32;%PATH%
set TASMTABS=%TOOLS%\tasm32

tasm -t80 -g3 -fFF testh8p.asm testh8p.com testh8p.lst || exit /b

copy /Y testh8p.com ..\..\..\..\Binary\Apps\Test\ || exit /b
6 changes: 6 additions & 0 deletions Source/Apps/Test/testh8p/Clean.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@echo off
setlocal

if exist *.com del *.com
if exist *.lst del *.lst
if exist *.bin del *.bin
9 changes: 9 additions & 0 deletions Source/Apps/Test/testh8p/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
OBJECTS = testh8p.com
# DOCS = testh8p.doc
DEST = ../../../../Binary/Apps/Test
DOCDEST = ../../../../Binary/Apps/Test
TOOLS =../../../../Tools

USETASM=1

include $(TOOLS)/Makefile.inc
238 changes: 238 additions & 0 deletions Source/Apps/Test/testh8p/testh8p.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
;===============================================================================
; H8 Panel Test
;===============================================================================
;
; AUTHOR: WAYNE WARTHEN ([email protected])
;_______________________________________________________________________________
;
;
; Trivial utility to test the register pair display functionality of the
; Heath H8 Front Panel.
;
; Program will display a set of known register values on the console,
; then go into an infinite loop. The H8 panel can then be checked to
; see if the correct values are displayed.
;
; There is no way to exit this program. You must reset your system.
;
;===============================================================================
; Definitions
;===============================================================================
;
stksiz .equ $40 ; Working stack size
;
restart .equ $0000 ; CP/M restart vector
bdos .equ $0005 ; BDOS invocation vector
;
regA .equ $11
regBC .equ $2233
regDE .equ $4455
regHL .equ $6677
;
;===============================================================================
; Code Section
;===============================================================================
;
;
.org $100
;
; setup stack (save old value)
ld (stksav),sp ; save stack
ld sp,stack ; set new stack
;
ld de,str_prefix
call prtstr
;
ld de,str_A
ld hl,regA
call prtreg
ld de,str_BC
ld hl,regBC
call prtreg
ld de,str_DE
ld hl,regDE
call prtreg
ld de,str_HL
ld hl,regHL
call prtreg
ld de,str_SP
ld hl,regSP
call prtreg
ld de,str_PC
ld hl,regPC
call prtreg
;
ld a,regA
ld bc,regBC
ld de,regDE
ld hl,regHL
regPC: jr $
;
;
;
prtreg:
call prtstr ; print label
ld a,h ; first byte
call prtoctbyte ; print it
ld a,'.' ; separator
call prtchr ; print it
ld a,l ; second byte
call prtoctbyte ; print it
ret
;
;
;
prtoctbyte:
rlca ; 2 ms bits
rlca
push af
and %00000011 ; isolate
add a,'0' ; make char
call prtchr ; show it
pop af
rlca ; next 3 bits
rlca
rlca
push af
and %00000111 ; isolate
add a,'0' ; make char
call prtchr ; show it
pop af
rlca ; next 3 bits
rlca
rlca
push af
and %00000111 ; isolate
add a,'0' ; make char
call prtchr ; show it
pop af
ret
;
; Print character in A without destroying any registers
;
prtchr:
push bc ; save registers
push de
push hl
ld e,a ; character to print in E
ld c,$02 ; BDOS function to output a character
call bdos ; do it
pop hl ; restore registers
pop de
pop bc
ret
;
; Print a zero terminated string at (DE) without destroying any registers
;
prtstr:
push de
;
prtstr1:
ld a,(de) ; get next char
or a
jr z,prtstr2
call prtchr
inc de
jr prtstr1
;
prtstr2:
pop de ; restore registers
ret
;
; Start a new line
;
crlf2:
call crlf ; two of them
crlf:
push af ; preserve AF
ld a,13 ; <CR>
call prtchr ; print it
ld a,10 ; <LF>
call prtchr ; print it
pop af ; restore AF
ret
;
; Print the value in A in hex without destroying any registers
;
prthex:
push af ; save AF
push de ; save DE
call hexascii ; convert value in A to hex chars in DE
ld a,d ; get the high order hex char
call prtchr ; print it
ld a,e ; get the low order hex char
call prtchr ; print it
pop de ; restore DE
pop af ; restore AF
ret ; done
;
; print the hex word value in hl
;
prthexword:
push af
ld a,h
call prthex
ld a,l
call prthex
pop af
ret
;
; print the hex dword value in de:hl
;
prthex32:
push bc
push de
pop bc
call prthexword
push hl
pop bc
call prthexword
pop bc
ret
;
; Convert binary value in A to ascii hex characters in DE
;
hexascii:
ld d,a ; save A in D
call hexconv ; convert low nibble of A to hex
ld e,a ; save it in E
ld a,d ; get original value back
rlca ; rotate high order nibble to low bits
rlca
rlca
rlca
call hexconv ; convert nibble
ld d,a ; save it in D
ret ; done
;
; Convert low nibble of A to ascii hex
;
hexconv:
and $0F ; low nibble only
add a,$90
daa
adc a,$40
daa
ret
;
;===============================================================================
; Storage Section
;===============================================================================
;
rtcbuf .fill 6,$FF ; RTC data buffer
;
str_prefix .db "\r\n\r\nRegisters: ",0
;
str_A .db "A=",0
str_BC .db ", BC=",0
str_DE .db ", DE=",0
str_HL .db ", HL=",0
str_SP .db ", SP=",0
str_PC .db ", PC=",0
;
stksav .dw 0 ; stack pointer saved at start
.fill stksiz,0 ; stack
stack .equ $ ; stack top
regSP:
;
.end
Loading

0 comments on commit e376e55

Please sign in to comment.