Subversion Repositories Spectranet

[/] [trunk/] [experiments/] [testtraps.asm] - Diff between revs 51 and 68

Show entire file | Details | Blame | View Log

Rev 51 Rev 68
Line 86... Line 86...
        ld hl, JTABLE1
        ld hl, JTABLE1
        ld de, 0x3FF8
        ld de, 0x3FF8
        ld bc, 8
        ld bc, 8
        ldir
        ldir
.waitforkey
.waitforkey
        call F_waitforkey       ; wait for a key to be pressed
        call F_waitforkey
 
        cp 1                    ; 'A'
 
        jp z, F_anexperiment
 
        cp 2
 
        jp z, F_startflashprog  ; 'S' - start flash programmer
 
        call F_inttohex8
 
        call F_print
 
;       cp 'F'                  ; want to run the flash util?
 
;       jp z, F_startflashprog  ; start the flash programmer if 'f' pressed
        ld hl, 0
        ld hl, 0
        add hl, sp              ; point hl at sp to munge stack contents
        add hl, sp              ; point hl at sp to munge stack contents
        ld (hl), 0              ; set current stack contents
        ld (hl), 0              ; set current stack contents
        inc hl
        inc hl
        ld (hl), 0              ; to zero so 'ret' does a reset
        ld (hl), 0              ; to zero so 'ret' does a reset
Line 573... Line 581...
        ld de, 0xF000   ; flash programmer org addr.
        ld de, 0xF000   ; flash programmer org addr.
        ld bc, ENDFLASH-STARTFLASH      ; size
        ld bc, ENDFLASH-STARTFLASH      ; size
        ldir
        ldir
        jp 0xF000
        jp 0xF000
 
 
 
F_anexperiment
 
        call F_zxinit
 
        call F_pagezxbasic
 
.keytestloop
 
        call F_getkey
 
        cp 32
 
        jp m, .showhex
 
        call putc_5by8
 
        call F_keyup
 
        jr .keytestloop
 
.showhex
 
        push af
 
        ld a, '['
 
        call putc_5by8
 
        pop af
 
        call F_inttohex8
 
        call F_print
 
        ld a, ']'
 
        call putc_5by8
 
        jr .keytestloop
 
 
 
 
 
 
; Include library routines
; Include library routines
        include "print5by8.asm"
        include "print5by8.asm"
        include "w5100config.asm"
        include "w5100config.asm"
        include "w5100buffer.asm"
        include "w5100buffer.asm"
 
        include "../rom/ui_input.asm"
 
        include "../rom/zxromcalls.asm"
 
        include "../rom/zxsysvars.asm"
 
        include "../rom/zxpaging.asm"
 
 
; Strings
; Strings
STR_reset       defb "Reset event trapped...\n", 0
STR_reset       defb "Reset event trapped...\n", 0
STR_rst8        defb "RST #8 trapped...", 0
STR_rst8        defb "RST #8 trapped...", 0
STR_nmi         defb "Caught NMI.\n", 0
STR_nmi         defb "Caught NMI.\n", 0
Line 631... Line 666...
v_copied        equ 0x3004      ; Wrapped copied so far
v_copied        equ 0x3004      ; Wrapped copied so far
v_hlsave        equ 0x3006      ; save hl for callbas
v_hlsave        equ 0x3006      ; save hl for callbas
v_desave        equ 0x3008
v_desave        equ 0x3008
v_interpaddr    equ 0x300A      ; extra interpreter to call
v_interpaddr    equ 0x300A      ; extra interpreter to call
v_runalready    equ 0x300C      ; 'run already' flag
v_runalready    equ 0x300C      ; 'run already' flag
 
v_bankm         equ 0x300D
 
v_bank678       equ 0x300E
 
 
; Spectrum ROM entry points
; Spectrum ROM entry points
ERROR_2         equ 0x0053
ERROR_2         equ 0x0053
ERR_SP          equ 23613
ERR_SP          equ 23613
ERR_NR          equ 23610
ERR_NR          equ 23610
Line 646... Line 683...
 
 
; various definitions
; various definitions
CHIPSEL         equ 0xED
CHIPSEL         equ 0xED
PAGEA           equ 0xE9
PAGEA           equ 0xE9
PAGEB           equ 0xEB
PAGEB           equ 0xEB
 
CALLBAS         equ 0x10