Subversion Repositories Spectranet

[/] [trunk/] [rom/] [basicextn.asm] - Diff between revs 244 and 255

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 244 Rev 255
Line 75... Line 75...
        ex de, hl               ; address of code is in DE
        ex de, hl               ; address of code is in DE
        rst CALLBAS
        rst CALLBAS
        defw ZX_GET_ERR         ; get the error code (which may be in ZX ROM)
        defw ZX_GET_ERR         ; get the error code (which may be in ZX ROM)
        cp 0x0B                 ; Nonsense in BASIC?
        cp 0x0B                 ; Nonsense in BASIC?
        jr z, .handled
        jr z, .handled
        cp 0x07                 ; End of file?
;       cp 0x07                 ; End of file?
        jp z, J_handleeof
;       jp z, J_handleeof
        jp J_rst8done
        jp J_rst8done
.handled
.handled
        ld (ZX_ERR_NR), a       ; Save the error number in ZX sysvars
        ld (ZX_ERR_NR), a       ; Save the error number in ZX sysvars
        ld (v_errnr_save), a    ; and ours.
        ld (v_errnr_save), a    ; and ours.
        ld hl, (ZX_CH_ADD)      ; save current CH_ADD
        ld hl, (ZX_CH_ADD)      ; save current CH_ADD
Line 215... Line 215...
        ex (sp), hl             ; put it on the stack, discarding old value
        ex (sp), hl             ; put it on the stack, discarding old value
        ld hl, (ZX_CH_ADD)      ; 1st instruction in ZX ROM RST8 routine
        ld hl, (ZX_CH_ADD)      ; 1st instruction in ZX ROM RST8 routine
        jp UNPAGE
        jp UNPAGE
 
 
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
J_handleeof
 
        ld hl, (v_eofaddr)      ; what address to jump to
 
        ld a, h                 ; if it's zero then
 
        or l                    ; return to BASIC
 
        jr z, J_rst8done
 
        ld a, (v_eofrom)        ; Page the right ROM if we need to
 
        and a
 
        jr z, .nopage
 
        ex af, af'
 
        ld a, (v_pgb)           ; get current page B
 
        ld (v_origpageb), a     ; and save it
 
        ex af, af'
 
        call F_setpageB         ; page the specified ROM
 
.nopage
 
        pop de                  ; remove stack entry
 
        jp (hl)
 
 
 
;---------------------------------------------------------------------------
 
; J_zxrom_exit
; J_zxrom_exit
; This exits to the BASIC ROM, resetting our private flags.
; This exits to the BASIC ROM, resetting our private flags.
; First stack entry should contain address where control should be returned.
; First stack entry should contain address where control should be returned.
J_zxrom_exit
J_zxrom_exit
        xor a
        xor a