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

Subversion Repositories t400

[/] [t400/] [trunk/] [sw/] [verif/] [include/] [int_macros.inc] - Blame information for rev 179

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 77 arniml
        ;; *******************************************************************
2 179 arniml
        ;; $Id: int_macros.inc 179 2009-04-01 19:48:38Z arniml $
3 77 arniml
        ;;
4
        ;; Defines macros for interrupt tests.
5
        ;;
6
 
7 79 arniml
        ;; -------------------------------------------------------------------
8
        ;; Save current A, M and C to M(3,15), M(3,14) and M(3,13).
9
        ;;
10 83 arniml
save_a_m_c      MACRO
11 79 arniml
        xad     3, 15           ; save A to M(3,15)
12
 
13
        x       0                ; save current M
14
        xad     3, 14           ; to M(3,14)
15
 
16
        smb     0x0             ; save C
17
        skc                     ; to M(3,13)
18
        rmb     0x0             ;
19
        x       0                ;
20
        xad     3, 13           ;
21
        ENDM
22
 
23
 
24
        ;; -------------------------------------------------------------------
25
        ;; Check SA against specified address
26
        ;;
27 77 arniml
check_sa        MACRO   addr
28
        ;; request nibble 0 of SA
29
        ogi     0x0
30
        inl
31
        ;; check this nibble
32
        x       0
33
        clra
34
        IF      addr & 0xf <> 0
35
        aisc    addr & 0xf
36
        ENDIF
37
        ske
38
        jmp     fail
39
 
40
        ;; request nibble 1 of SA
41
        ogi     0x1
42
        inl
43
        ;; check this nibble
44
        x       0
45
        clra
46
        IF      addr & 0x0f0 <> 0
47
        aisc    (addr >> 4) & 0xf
48
        ENDIF
49
        ske
50
        jmp     fail
51
 
52
        ;; request nibble 2 of SA
53
        ogi     0x2
54
        inl
55
        ;; check this nibble
56
        x       0
57
        clra
58
        IF      addr & 0xf00 <> 0
59
        aisc    (addr >> 8) & 0xf
60
        ENDIF
61
        ske
62
        jmp     fail
63
 
64
        ENDM
65 79 arniml
 
66
 
67
        ;; -------------------------------------------------------------------
68
        ;; Restore C, M and A from M(3,13), M(3,14) and M(3,15)
69
        ;;
70 83 arniml
restore_c_m_a   MACRO
71 79 arniml
        xad     3, 13           ; restore C
72
        x       0                ; from M(3,13)
73
        rc                      ;
74
        skmbz   0x0             ;
75
        sc                      ;
76
 
77
        xad     3, 14           ; restore current M
78
        x       0                ; from M(3,14)
79
 
80
        xad     3, 15           ; restore A
81
        ENDM
82 86 arniml
 
83
 
84
        ;; -------------------------------------------------------------------
85
        ;; Flag that interrupt occured in M(3,12).1
86
        ;;
87
int_flag_set    MACRO
88
        clra
89
        aisc    0x1
90
        xad     3, 12
91
        ENDM
92
 
93
        ;; -------------------------------------------------------------------
94
        ;; Clear 'interrupt occured' flag
95
        ;;
96
int_flag_clear  MACRO
97
        clra
98
        xad     3, 12
99
        ENDM
100
 
101
        ;; -------------------------------------------------------------------
102
        ;; Check interrupt occurence
103
        ;;
104
int_flag_check  MACRO
105
        lbi     3, 12
106
        skmbz   0x0
107
        jp      +
108
        jmp     fail            ; no interrupt!
109
+       lbi     0, 0
110
        ENDM

powered by: WebSVN 2.1.0

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