diff --git a/Source/CPM3/bioskrnl.asm b/Source/CPM3/bioskrnl.asm index 32e918b9..ab3a9ccd 100644 --- a/Source/CPM3/bioskrnl.asm +++ b/Source/CPM3/bioskrnl.asm @@ -244,7 +244,7 @@ co$next: push h ; save the vector push b ; save the count and character not$out$ready: - call coster ! ora a ! jz not$out$ready + push b ! call coster ! pop b ! ora a ! jz not$out$ready pop b ! push b ; restore and resave the character and device call ?co ; if device selected, print it pop b ; recover count and character diff --git a/Source/CPM3/boot.z80 b/Source/CPM3/boot.z80 index d0b5cb0f..47787569 100644 --- a/Source/CPM3/boot.z80 +++ b/Source/CPM3/boot.z80 @@ -667,4 +667,76 @@ drvtbladr dw @dtbl ; drive map address (filled in later) dphtbladr dw dph0 ; dpb map address cbxsiz equ $ - cbx + if 0 +; +; Print the hex word value in HL +; +phex16: + push af + ld a,h + call phex8 + ld a,l + call phex8 + pop af + ret +; +; Print the hex byte value in A +; +phex8: + push af + push de + call hexascii + ld a,d + call cout + ld a,e + call cout + pop de + pop af + ret + +; +; Convert binary value in A to ascii hex characters in DE +; +hexascii: + ld d,a + call hexconv + ld e,a + ld a,d + rlca + rlca + rlca + rlca + call hexconv + ld d,a + ret +; +; convert low nibble of A to ascii hex +; +hexconv: + and 0fh ;low nibble only + add a,90h + daa + adc a,40h + daa + ret +; +; output character from A +; +cout: + ; save all incoming registers + push af + push bc + push de + push hl + ld e,a + ld bc,0100h + rst 08 + pop hl + pop de + pop bc + pop af + ret + + endif + end