Skip to content

Commit 169cf10

Browse files
committed
BSAC304: Add test.asm
1 parent dad9018 commit 169cf10

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

examples/bsac304/test.asm

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
%include "common"
2+
3+
start:
4+
T var_x
5+
A const_1
6+
U var_x
7+
J error; acc should be +1
8+
G error; acc should be +1
9+
T var_x
10+
E error; acc should be 0
11+
G error; acc should be 0
12+
S const_2
13+
J error; acc should be -2
14+
E error; acc should be -2
15+
X
16+
X
17+
T var_x;
18+
U var_x; x = 0
19+
A nreps
20+
loop:
21+
; acc should be the updated 'nreps' here
22+
T nreps
23+
A var_x
24+
A const_1
25+
U var_x
26+
A var_x; compute y = 2x
27+
T var_y
28+
A nreps
29+
S const_1
30+
E loop
31+
Z
32+
33+
34+
error:
35+
T var_x
36+
A const_EEEE
37+
Z
38+
39+
const_1:
40+
data 1
41+
const_2:
42+
data 2
43+
const_EEEE:
44+
data 0xEEEE
45+
nreps:
46+
data 10
47+
var_x:
48+
data 0
49+
var_y:
50+
data 0

0 commit comments

Comments
 (0)