Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only xon/xoff serial consoles are working #1

Open
pawosm-arm opened this issue Jul 22, 2023 · 0 comments
Open

Only xon/xoff serial consoles are working #1

pawosm-arm opened this issue Jul 22, 2023 · 0 comments

Comments

@pawosm-arm
Copy link

This is somewhat annoying bug, eventually I've managed to get to the point where it kicks in.

If a serial device is not xon/xoff, a jump to _cost function is being done, but since it is not call, just a jump, linker somehow did not resolve it correctly and it jumps somewhere, but not where it supposed to. A small patch like this one helps to sort it out:

diff --git a/CPM3.0/src/BIOSKRNL.ASM b/CPM3.0/src/BIOSKRNL.ASM
index 81fab54..a61f22f 100644
--- a/CPM3.0/src/BIOSKRNL.ASM
+++ b/CPM3.0/src/BIOSKRNL.ASM
@@ -282,7 +282,7 @@ coster: ; check for output device ready, including optional
     LD      A,(HL) 
     AND     010H        ; mb_xonxoff
     POP     HL      ; recover console number in <HL>
-    JR      Z,_cost     ; not a xon device, go get output status direct
+    JR      Z,cost_direct   ; not a xon device, go get output status direct
     LD      DE,xofflist 
     ADD     HL,DE       ; make pointer to proper xon/xoff flag
     CALL    cist1       ; see if this keyboard has character
@@ -300,6 +300,9 @@ not_s:
     CALL    cost1       ; get the actual output status,
     AND     (HL)        ; and mask with ctl-Q/ctl-S flag
     RET         ; return this as the status
+cost_direct:
+    CALL    _cost
+    RET
 cist1:  ; get input status with <BC> and <HL> saved
     PUSH    BC 
     PUSH    HL

I wonder how often this idiom is used, may be a source of a few mysterious problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant