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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [sing-op_push_rom-rd.s43] - Blame information for rev 141

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 olivier.gi
/*===========================================================================*/
2
/* Copyright (C) 2001 Authors                                                */
3
/*                                                                           */
4
/* This source file may be used and distributed without restriction provided */
5
/* that this copyright statement is not removed from the file and that any   */
6
/* derivative work contains the original copyright notice and the associated */
7
/* disclaimer.                                                               */
8
/*                                                                           */
9
/* This source file is free software; you can redistribute it and/or modify  */
10
/* it under the terms of the GNU Lesser General Public License as published  */
11
/* by the Free Software Foundation; either version 2.1 of the License, or    */
12
/* (at your option) any later version.                                       */
13
/*                                                                           */
14
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
15
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     */
16
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public       */
17
/* License for more details.                                                 */
18
/*                                                                           */
19
/* You should have received a copy of the GNU Lesser General Public License  */
20
/* along with this source; if not, write to the Free Software Foundation,    */
21
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA        */
22
/*                                                                           */
23
/*===========================================================================*/
24
/*                     PUSH:   DATA READ ACCESS FROM ROM                     */
25
/*---------------------------------------------------------------------------*/
26
/* Test the PUSH instruction with all addressing modes making a read access  */
27
/* to the ROM.                                                               */
28 18 olivier.gi
/*                                                                           */
29
/* Author(s):                                                                */
30
/*             - Olivier Girard,    olgirard@gmail.com                       */
31
/*                                                                           */
32
/*---------------------------------------------------------------------------*/
33 19 olivier.gi
/* $Rev: 141 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2012-05-05 23:22:06 +0200 (Sat, 05 May 2012) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38 141 olivier.gi
.include "pmem_defs.asm"
39 2 olivier.gi
 
40
.global main
41
 
42
main:
43
        /* -------------- TEST INSTRUCTION IN WORD MODE ------------------- */
44
 
45
        # Initialization
46
        #------------------------
47
 
48
        mov     #0x0020, r4        ;# Initialize RAM
49 111 olivier.gi
        mov   #DMEM_230, r5
50 2 olivier.gi
clear_mem_loop:
51
        clr    0(r5)
52
        incd     r5
53
        dec      r4
54
        jnz     clear_mem_loop
55
 
56
 
57 111 olivier.gi
        mov   #DMEM_252, r1        ;# Initialize stack pointer
58 2 olivier.gi
 
59
 
60
        mov     #0x1000, r15
61
 
62
 
63
        # Addressing mode: @Rn
64
        #------------------------
65
 
66
        mov     #data_aRn_0x1234, r4
67
        push                     @r4           ;# PUSH (0x1234  =>  @=0x0250)
68
 
69
        mov     #data_aRn_0x5678, r6
70
        push                     @r6           ;# PUSH (0x5678  =>  @=0x024E)
71
 
72
        mov              #0x2000, r15
73
 
74
 
75
        # Addressing mode: @Rn+
76
        #------------------------
77
 
78
        mov     #data_aRni_0x9abc, r4
79
        push                      @r4+         ;# PUSH (0x9abc  =>  @=0x024C)
80
        push                      @r4+         ;# PUSH (0xdef0  =>  @=0x024A)
81
 
82
        mov     #0x3000, r15
83
 
84
 
85
        # Addressing mode: X(Rn)
86
        #------------------------
87
 
88
        mov     #data_xRn_0x0fed, r4
89
        push                   26(r4)          ;# PUSH (0x0fed  =>  @=0x0248)
90
        push                   28(r4)          ;# PUSH (0xcba9  =>  @=0x0246)
91
 
92
        mov     #0x4000, r15
93
 
94
 
95
        # Addressing mode: EDE
96
        #------------------------
97 111 olivier.gi
.set   EDE_21E,  DMEM_21E
98
.set   EDE_220,  DMEM_220
99 2 olivier.gi
 
100
        push    data_EDE_0x8765                ;# PUSH (0x8765  =>  @=0x0244)
101
        push    data_EDE_0x4321                ;# PUSH (0x4321  =>  @=0x0242)
102
 
103
        mov     #0x5000, r15
104
 
105
 
106
        # Addressing mode: &EDE
107
        #------------------------
108 111 olivier.gi
.set   aEDE_222,  DMEM_222
109
.set   aEDE_224,  DMEM_224
110 2 olivier.gi
 
111
        push  &data_aEDE_0x1f2e                ;# PUSH (0x1f2e  =>  @=0x0240)
112
        push  &data_aEDE_0x3d4c                ;# PUSH (0x3d4c  =>  @=0x023E)
113
 
114
        mov     #0x6000, r15
115
 
116
 
117
 
118
        /* ----------------------         END OF TEST        --------------- */
119
end_of_test:
120
        nop
121
        br #0xffff
122
 
123
 
124
        /* ----------------------            DATA TABLE      --------------- */
125
data_aRn_0x1234:
126
        .word 0x1234
127
data_aRn_0x5678:
128
        .word 0x5678
129
 
130
data_aRni_0x9abc:
131
        .word 0x9abc
132
        .word 0xdef0
133
 
134
data_xRn_0x0fed:
135
        .word 0x0000
136
        .word 0x0000
137
        .word 0x0000
138
        .word 0x0000
139
        .word 0x0000
140
        .word 0x0000
141
        .word 0x0000
142
        .word 0x0000
143
        .word 0x0000
144
        .word 0x0000
145
        .word 0x0000
146
        .word 0x0000
147
        .word 0x0000
148
        .word 0x0fed
149
        .word 0xcba9
150
 
151
data_EDE_0x8765:
152
        .word 0x8765
153
data_EDE_0x4321:
154
        .word 0x4321
155
 
156
data_aEDE_0x1f2e:
157
        .word 0x1f2e
158
data_aEDE_0x3d4c:
159
        .word 0x3d4c
160
 
161
 
162
        /* ----------------------         INTERRUPT VECTORS  --------------- */
163
 
164
.section .vectors, "a"
165
.word end_of_test  ; Interrupt  0 (lowest priority)    
166
.word end_of_test  ; Interrupt  1                      
167
.word end_of_test  ; Interrupt  2                      
168
.word end_of_test  ; Interrupt  3                      
169
.word end_of_test  ; Interrupt  4                      
170
.word end_of_test  ; Interrupt  5                      
171
.word end_of_test  ; Interrupt  6                      
172
.word end_of_test  ; Interrupt  7                      
173
.word end_of_test  ; Interrupt  8                      
174
.word end_of_test  ; Interrupt  9                      
175
.word end_of_test  ; Interrupt 10                      Watchdog timer
176
.word end_of_test  ; Interrupt 11                      
177
.word end_of_test  ; Interrupt 12                      
178
.word end_of_test  ; Interrupt 13                      
179
.word end_of_test  ; Interrupt 14                      NMI
180
.word main         ; Interrupt 15 (highest priority)   RESET

powered by: WebSVN 2.1.0

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