;; *******************************************************************
|
;; *******************************************************************
|
;; $Id: test.asm,v 1.1 2006-05-28 19:21:13 arniml Exp $
|
;; $Id: test.asm 179 2009-04-01 19:48:38Z arniml $
|
;;
|
;;
|
;; Checks interrupt on JSRP and RETSK.
|
;; Checks interrupt on JSRP and RETSK.
|
;;
|
;;
|
|
|
;; the cpu type is defined on asl's command line
|
;; the cpu type is defined on asl's command line
|
|
|
include "int_macros.inc"
|
include "int_macros.inc"
|
|
|
org 0x00
|
org 0x00
|
clra
|
clra
|
|
|
int_flag_clear
|
int_flag_clear
|
;; write return instruction identifier to current M
|
;; write return instruction identifier to current M
|
;; ret_instr_1b0 = 0x01
|
;; ret_instr_1b0 = 0x01
|
clra
|
clra
|
aisc 0x1
|
aisc 0x1
|
x 0
|
x 0
|
|
|
lei 0x02
|
lei 0x02
|
jmp int_mark_1b0
|
jmp int_mark_1b0
|
|
|
org 0x1b0
|
org 0x1b0
|
int_mark_1b0:
|
int_mark_1b0:
|
nop
|
nop
|
nop
|
nop
|
int_instr_1b0:
|
int_instr_1b0:
|
jsrp prep_0b0
|
jsrp prep_0b0
|
aisc 0x1 ; to be skipped by retsk
|
aisc 0x1 ; to be skipped by retsk
|
ret_instr_0b0:
|
ret_instr_0b0:
|
;; check whether aisc has been skipped
|
;; check whether aisc has been skipped
|
x 0
|
x 0
|
clra
|
clra
|
ske
|
ske
|
jmp fail
|
jmp fail
|
;; check whether interrupt really occured
|
;; check whether interrupt really occured
|
int_flag_check
|
int_flag_check
|
|
|
jmp pass
|
jmp pass
|
|
|
|
|
org 0x090
|
org 0x090
|
jmp fail
|
jmp fail
|
org 0x092
|
org 0x092
|
prep_0b0:
|
prep_0b0:
|
nop
|
nop
|
ret_instr_1b0:
|
ret_instr_1b0:
|
;; check whether interrupt really occured
|
;; check whether interrupt really occured
|
int_flag_check
|
int_flag_check
|
|
|
;;
|
;;
|
;; prepare next interrupt
|
;; prepare next interrupt
|
;;
|
;;
|
int_flag_clear
|
int_flag_clear
|
;; write return instruction identifier to current M
|
;; write return instruction identifier to current M
|
;; ret_instr_0b0 = 0x2
|
;; ret_instr_0b0 = 0x2
|
clra
|
clra
|
aisc 0x2
|
aisc 0x2
|
x 0
|
x 0
|
|
|
lei 0x02
|
lei 0x02
|
jp int_mark_0b0
|
jp int_mark_0b0
|
|
|
org 0x0ae
|
org 0x0ae
|
jmp fail
|
jmp fail
|
org 0x0b0
|
org 0x0b0
|
int_mark_0b0:
|
int_mark_0b0:
|
nop
|
nop
|
clra
|
clra
|
int_instr_0b0:
|
int_instr_0b0:
|
retsk
|
retsk
|
|
|
|
|
;; *******************************************************************
|
;; *******************************************************************
|
;; Interrupt routine
|
;; Interrupt routine
|
;;
|
;;
|
org 0x0fd
|
org 0x0fd
|
jmp fail
|
jmp fail
|
int_routine:
|
int_routine:
|
nop
|
nop
|
save_a_m_c
|
save_a_m_c
|
|
|
int_flag_set
|
int_flag_set
|
|
|
;; access current M of main program
|
;; access current M of main program
|
ldd 3, 14
|
ldd 3, 14
|
x 0
|
x 0
|
skmbz 0x0
|
skmbz 0x0
|
jp check_sa_1b0
|
jp check_sa_1b0
|
skmbz 0x1
|
skmbz 0x1
|
jp check_sa_0b0
|
jp check_sa_0b0
|
jmp fail
|
jmp fail
|
|
|
check_sa_1b0:
|
check_sa_1b0:
|
check_sa ret_instr_1b0
|
check_sa ret_instr_1b0
|
jmp int_finished
|
jmp int_finished
|
check_sa_0b0:
|
check_sa_0b0:
|
check_sa ret_instr_0b0
|
check_sa ret_instr_0b0
|
|
|
int_finished:
|
int_finished:
|
restore_c_m_a
|
restore_c_m_a
|
ret
|
ret
|
;;
|
;;
|
;; *******************************************************************
|
;; *******************************************************************
|
|
|
|
|
org 0x200
|
org 0x200
|
include "int_pass_fail.asm"
|
include "int_pass_fail.asm"
|
|
|