Commit | Line | Data |
---|---|---|
7f743288 TR |
1 | ;; |
2 | ;; address-001.s | |
3 | ;; Test supported indirect addressing | |
4 | ;; | |
5 | ||
6 | .text | |
7 | .global main | |
8 | main: | |
9 | ;; | |
10 | ;; Indirect | |
11 | ;; | |
12 | ldb r0,@r2 | |
13 | ldub r0,@r2 | |
14 | ld r0,@r2 | |
15 | ld2w r0,@r2 | |
16 | stb r0,@r2 | |
17 | st r0,@r2 | |
18 | st2w r0,@r2 | |
19 | ||
20 | ;; | |
21 | ;; Indirect with post increment | |
22 | ;; | |
23 | ld r0,@r2+ | |
24 | ld2w r0,@r2+ | |
25 | st r0,@r2+ | |
26 | st2w r0,@r2+ | |
27 | ||
28 | ;; | |
29 | ;; Indirect with postdecrement | |
30 | ;; | |
31 | ld r0,@r2- | |
32 | ld2w r0,@r2- | |
33 | st r0,@r2- | |
34 | st2w r0,@r2- | |
35 | ||
36 | ;; | |
37 | ;; Indirect through stackpointer | |
38 | ;; | |
39 | ldb r0,@sp | |
40 | ldub r0,@sp | |
41 | ld r0,@sp | |
42 | ld2w r0,@sp | |
43 | stb r0,@sp | |
44 | st r0,@sp | |
45 | st2w r0,@sp | |
46 | ||
47 | ;; | |
48 | ;; Indirect through stackpointer with postincrement | |
49 | ;; | |
50 | ld r0,@sp+ | |
51 | ld2w r0,@sp+ | |
52 | st r0,@sp+ | |
53 | st2w r0,@sp+ | |
54 | ||
55 | ;; | |
56 | ;; Indirect through stackpointer with postdecrement | |
57 | ;; | |
58 | ld r0,@sp- | |
59 | ld2w r0,@sp- | |
60 | ||
61 | ;; | |
62 | ;; Indirect through stackpointer with predecrement | |
63 | ;; | |
64 | st r0,@-sp | |
65 | st2w r0,@-sp | |
66 | ||
67 | ;; | |
68 | ;; Indirect with displacement | |
69 | ;; | |
70 | ldb r0,@(0x8000,r2) | |
71 | ldub r0,@(0x8000,r2) | |
72 | ld r0,@(0x8000,r2) | |
73 | ld2w r0,@(0x8000,r2) | |
74 | stb r0,@(0x8000,r2) | |
75 | st r0,@(0x8000,r2) | |
76 | st2w r0,@(0x8000,r2) | |
77 | ||
78 | jmp r13 |