srt0-aux.s
1.39 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*****************************************************************************/
/* */
/* Projecto de Compiladores ---------------------------------- VSPL */
/* Level 0 */
/* */
/* VSPL run-time library (as part). */
/* */
/* Salvador Pinto Abreu */
/* */
/*****************************************************************************/
.set rp, %11
.data
result: .long 0
.text
.globl _sspl_main
.globl program
_sspl_main:
.word 0x0000
pushr $0xFFFF
moval 0, ap
moval result, r11
jsb program
popr $0xFFFF
movl result, r0
ret
# VSPL glue routines
.globl writeInt
writeInt:
pushl (ap)
calls $1, _writeInt
rsb
.globl writeReal
writeReal:
pushl (ap)
calls $1, _writeReal
rsb
.globl writeBool
writeBool:
cvtbl (ap), r0
pushl r0
calls $1, _writeBool
rsb
.globl writeChar
writeChar:
pushl (ap)
calls $1, _writeChar
rsb
.globl writeString
writeString:
pushal 2(ap)
cvtwl (ap), -(sp)
calls $2, _writeString
rsb
.globl readInt
readInt:
calls $0, _readInt
movl r0, (r11)
rsb
.globl readReal
readReal:
calls $0, _readReal
movl r0, (r11)
rsb
.globl readBool
readBool:
calls $0, _readBool
movb r0, (r11)
rsb
.globl readString
readString:
pushab 2(r11)
pushaw (r11)
calls $2, _readString
rsb