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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_1/] [sw/] [verif/] [white_box/] [int_on_call/] [test.asm] - Blame information for rev 292

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 184 arniml
        ;; *******************************************************************
2
        ;; $Id: test.asm,v 1.1 2005-09-07 20:24:30 arniml Exp $
3
        ;;
4
        ;; Test interrupt on CALL in Program Memory Bank 1.
5
        ;; *******************************************************************
6
 
7
        INCLUDE "cpu.inc"
8
        INCLUDE "pass_fail.inc"
9
 
10
test_byte:      equ     020h
11
 
12
        ORG     0
13
 
14
        ;; Start of test
15
        jmp     start
16
 
17
        ORG     3
18
        ;; check that interrupt hit CALL instruction
19
        ;; stack must contain target of CALL instruction at
20
        ;; location call_instruction
21
        mov     r0, #00ch
22
        mov     a, @r0
23
        ;; check low byte of program counter on stack
24
        xrl     a, #000h
25
        jnz     fail
26
        inc     r0
27
        mov     a, @r0
28
        anl     a, #00fh
29
        ;; check high byte of program counter on stack
30
        mov     r0, a
31
        xrl     a, #009h        ; target of PASS case?
32
        jz      int_goon
33
        mov     a, r0
34
        xrl     a, #001h        ; target of FAIL case?
35
        jnz     fail
36
 
37
int_goon:
38
        ;; interrupt hit correct instruction
39
        mov     r0, #test_byte
40
        mov     a, #0ffh
41
        mov     @r0, a
42
        retr
43
 
44
start:
45
        ;; enable interrupt
46
        en      i
47
 
48
        ;; clear test byte
49
        mov     r1, #test_byte
50
        clr     a
51
        mov     @r1, a
52
 
53
        call    program_memory_bank_1
54
        sel     mb0
55
 
56
        ;; check if interrupt was successful
57
        mov     a, @r1
58
        jz      fail
59
 
60
 
61
pass:   PASS
62
 
63
fail:   FAIL
64
 
65
 
66
        ORG     0100H
67
        ;; program flow continues in fail case at address 0100h
68
        ;; after interrupt
69
        ;; i.e. bit 11 of address is erroneously cleared.
70
 
71
        ;; make sure that jump to fail reaches memory bank 0
72
        sel     mb0
73
        jmp     fail
74
 
75
 
76
        ORG     0800H
77
program_memory_bank_1:
78
        ;; spend some time and wait for interrupt
79
        mov     r2, #013h
80
        djnz    r2, $
81
 
82
call_instruction:
83
        ;; interrupt must hit this CALL (checked by examining stack
84
        ;; in interrupt handler)
85
        call    test_call
86
        ret
87
 
88
        ORG     0900H
89
test_call:
90
        ;; program flow continues in pass case here after interrupt
91
        ret

powered by: WebSVN 2.1.0

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