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

Subversion Repositories t48

[/] [t48/] [tags/] [rel_1_1/] [sw/] [verif/] [black_box/] [call/] [call_ret/] [test.asm] - Blame information for rev 292

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 arniml
        ;; *******************************************************************
2
        ;; $Id: test.asm,v 1.1.1.1 2004-03-25 22:29:17 arniml Exp $
3
        ;;
4
        ;; Test CALL + RET(R) with simple program.
5
        ;; *******************************************************************
6
 
7
        INCLUDE "cpu.inc"
8
        INCLUDE "pass_fail.inc"
9
 
10
        ORG     0
11
 
12
        ;; Start of test
13
        mov     r0, #008H
14
        call    recursive
15
 
16
call1:  call    sub1
17
        jc      fail
18
        jf0     fail
19
        jf1     ok_1
20
        jmp     fail
21
ok_1:
22
        ;; check stack contents
23
        mov     r0, #008H
24
        mov     a, @r0
25
        add     a, #(~(call1+2 & 0FFH) + 1) & 0FFH
26
        jnz     fail
27
 
28
        inc     r0
29
        mov     a, @r0
30
        add     a, #(~((call1+2) >> 8) + 1) & 0FFH
31
        jnz     fail
32
 
33
        inc     r0
34
        mov     a, @r0
35
        add     a, #(~(call2+2 & 0FFH) + 1) & 0FFH
36
        jnz     fail
37
 
38
        inc     r0
39
        mov     a, @r0
40
        add     a, #(~((call2+2) >> 8 | 0A0H) + 1) & 0FFH
41
        jnz     fail
42
 
43
 
44
        clr     c
45
        clr     f0
46
        clr     f1
47
        call    sub3
48
        jc      fail
49
        jf0     fail
50
 
51
pass:   PASS
52
 
53
fail:   FAIL
54
 
55
 
56
 
57
        ORG     0156H
58
recursive:
59
        dec     r0
60
        mov     a, r0
61
        jz      rec_end
62
        call    recursive
63
rec_end:
64
        ret
65
 
66
 
67
        ORG     0245H
68
 
69
sub1:   cpl     f0
70
        cpl     f1
71
        cpl     c
72
call2:  call    sub2
73
        jf0     sub1_1
74
        jmp     fail2
75
sub1_1: jnc     fail2
76
        retr
77
 
78
sub2:   jf0     sub2_1
79
        jmp     fail2
80
sub2_1: clr     f0
81
        jnc     fail2
82
        clr     c
83
        retr
84
 
85
fail2:  FAIL
86
 
87
 
88
        ORG     0311H
89
 
90
sub3:   cpl     f0
91
        cpl     c
92
        call    sub4
93
        jf0     fail3
94
        jc      fail3
95
        ret
96
 
97
sub4:   jf0     sub4_1
98
        jmp     fail3
99
sub4_1: clr     f0
100
        jnc     fail3
101
        clr     c
102
        ret
103
 
104
fail3:  FAIL

powered by: WebSVN 2.1.0

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