-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.urcl
67 lines (63 loc) · 1.23 KB
/
example.urcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
BITS 8
MINHEAP 0
MINSTACK 200
MINREG 5
CAL .URSL_func_main
HLT
.URSL_data_str
DW [ 'H' 'e' 'l' 'l' 'o' ',' ' ' 'W' 'o' 'r' 'l' 'd' '!' '\n' 0 ]
.URSL_data_num
DW 32
.URSL_data_nums
DW [ 1 2 3 4 @MAX ]
.URSL_data_vtable__or__something
DW [ .URSL_func_fib ]
.URSL_data_matrix8x8
DW [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ]
.URSL_data_thats__awesome
DW [ 'T' 'h' 'a' 't' '\'' 's' ' ' 'a' 'w' 'e' 's' 'o' 'm' 'e' '!' ]
.URSL_func_example_dot_module_dot_func
RET
.URSL_func_fib
LLOD $1 SP 1
MOV $2 $1
IMM $1 0
BRE .URSL_func_fib_label_base__case $2 0
BRE .URSL_func_fib_label_base__case $2 1
SUB $3 $2 1
PSH $1
PSH $2
PSH $3
CAL .URSL_func_fib
ADD SP SP 1
POP $4
POP $3
SUB $1 $4 2
PSH $3
PSH $2
PSH $1
CAL .URSL_func_fib
ADD SP SP 1
POP $4
POP $5
ADD $1 $4 $2
MOV $2 $1
MOV $1 $5
RET
.URSL_func_fib_label_base__case
RET
.URSL_func_main
PSH 20
CAL .URSL_func_fib
ADD SP SP 1
OUT %NUMB $2
RET
.URSL_func_print__string
LLOD $1 SP 1
.URSL_func_print__string_label_loop
LOD $2 $1
BRE .URSL_func_print__string_label_exit $2 0
OUT %TEXT $2
JMP .URSL_func_print__string_label_loop
.URSL_func_print__string_label_exit
RET