OpenCores
URL https://opencores.org/ocsvn/t400/t400/trunk

Subversion Repositories t400

[/] [t400/] [trunk/] [sw/] [verif/] [int/] [lbi/] [test.asm] - Blame information for rev 179

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 98 arniml
        ;; *******************************************************************
2 179 arniml
        ;; $Id: test.asm 179 2009-04-01 19:48:38Z arniml $
3 98 arniml
        ;;
4
        ;; Checks interrupt on LBI.
5
        ;; LBI is interrupted twice:
6
        ;;   1) short, 1 byte instruction
7
        ;;   2) long, 2 byte instruction
8
        ;;
9
 
10
        ;; the cpu type is defined on asl's command line
11
 
12
        include "int_macros.inc"
13
 
14
        org     0x00
15
        clra
16
 
17
        ;; prepare RAM digits
18
        lbi     0, 3
19
        stii    0x3
20
        lbi     0, 9
21
        stii    0x9
22
        lbi     0, 0            ; default RAM location
23
 
24
        int_flag_clear
25
        ;; write return instruction identifier to current M
26
        ;; ret_instr_030 = 0x01
27
        clra
28
        aisc    0x1
29
        x       0
30
 
31
        lei     0x02
32
        jp      int_mark_030
33
 
34
        org     0x030
35
int_mark_030:
36
        nop
37
        nop
38
int_instr_030:
39
        lbi     0, 9            ; short LBI
40
        nop
41
ret_instr_030:
42
        nop
43
 
44
        ;; check whether interrupt really occured
45
        int_flag_check
46
 
47
        ;;
48
        ;; prepare next interrupt
49
        ;;
50
        int_flag_clear
51
        ;; write return instruction identifier to current M
52
        ;; ret_instr_0b0 = 0x2
53
        clra
54
        aisc    0x2
55
        x       0
56
 
57
        lei     0x02
58
        jmp     int_mark_0b0
59
 
60
        org     0x0ae
61
        jmp     fail
62
        org     0x0b0
63
int_mark_0b0:
64
        nop
65
        nop
66
int_instr_0b0:
67
        lbi     0, 3            ; long LBI
68
        nop
69
ret_instr_0b0:
70
        nop
71
 
72
        ;; check whether interrupt really occured
73
        int_flag_check
74
        jmp     pass
75
 
76
 
77
        ;; *******************************************************************
78
        ;; Interrupt routine
79
        ;;
80
        org     0x0fd
81
        jmp     fail
82
int_routine:
83
        nop
84
        save_a_m_c
85
 
86
        int_flag_set
87
 
88
        ;; read interrupt location selector
89
        lbi     0, 0
90
        ldd     0, 0
91
        x       0
92
        skmbz   0x0
93
        jp      check_sa_030
94
        skmbz   0x1
95
        jmp     check_sa_0b0
96
        jmp     fail
97
 
98
check_sa_030:
99
        check_sa        ret_instr_030
100
        ;; check saved contents of 'current M'
101
        ;; expect 0x9
102
        lbi     3, 14
103
        clra
104
        aisc    0x9
105
        ske
106
        jmp     fail
107
        jmp     int_finished
108
 
109
check_sa_0b0:
110
        check_sa        ret_instr_0b0
111
        ;; check saved contents of 'current M'
112
        ;; expect 0x3
113
        lbi     3, 14
114
        clra
115
        aisc    0x3
116
        ske
117
        jmp     fail
118
 
119
int_finished:
120
        lbi     0, 0
121
        restore_c_m_a
122
        ret
123
        ;;
124
        ;; *******************************************************************
125
 
126
 
127
        org     0x200
128
        include "int_pass_fail.asm"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.