]> cloudbase.mooo.com Git - z180-stamp-cpm3.git/blobdiff - cbios/cfio.180
local stack for 'sdio' and 'cfio'
[z180-stamp-cpm3.git] / cbios / cfio.180
index 5dd8a2e8a1045aa6dccc7f19b410f04cc48a1cc3..fc3bea1187504bc6a2051df6979fd2e9a6d32bb7 100644 (file)
@@ -649,6 +649,9 @@ rw$common:
    endif\r
 \r
 rwc_new_sectors:\r
+       ld      (cfstack),sp\r
+       ld      sp,cfstack\r
+\r
        in0     a,(dcntl)\r
        and     a,~(M_DMS1+M_DIM1+M_DIM0)\r
        or      b\r
@@ -705,7 +708,8 @@ retry:
        pop     hl\r
        jr      c,lba_ok\r
        ld      a,1             ; block# >= partition size, return error\r
-       ret\r
+       jp      exit\r
+;      ret\r
 \r
 lba_ok:\r
        WAITREADY\r
@@ -762,7 +766,8 @@ err_out:
        pop     bc\r
        ld      e,a\r
        and     10001001b       ; Busy, DRQ, or Error?\r
-       ret     z               ; Return to BDOS if no error\r
+       jr      z,exit\r
+;      ret     z               ; Return to BDOS if no error\r
 \r
        ld      hl,print_details\r
        call    pr.errors\r
@@ -772,6 +777,8 @@ err_out:
        ld      (residual),a\r
 \r
        ld      a,1             ; return hard error to BDOS\r
+exit:\r
+       ld      sp,(cfstack)\r
        ret\r
 \r
 ;-------------------------------------------------------------------------------\r
@@ -824,4 +831,10 @@ parttbl:
 tmpsecbuf:             ;temporary sector buffer\r
        ds      512\r
 \r
+       rept    80\r
+        db     07CH\r
+       endm\r
+cfstack::\r
+       dw      0\r
+\r
        end\r