-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.q
46 lines (32 loc) · 1011 Bytes
/
test.q
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
/*********************************** test.q **********************************/
entry main
/******************************** SIO defines ********************************/
#define SIORBR [0xFFFD00]. /* receive buffer register */
#define SIOTHR [0xFFFD00]. /* transmit holding register */
#define SIOLSR [0xFFFD14]. /* line status register */
#define DR 0x01 /* receive data ready */
#define THRE 0x20 /* thansmit holding register empty */
/*********************************** putc ************************************/
define putc(c)
begin
repeat
/* null */
until SIOLSR & THRE
SIOTHR := c
end
/*********************************** puts ************************************/
define puts(s)
begin
while [s]. do
call putc([s].)
s := s + 1
end
end
/*********************************** main ************************************/
string hello "hello world!\r\n\0"
define main()
begin
while 1 do
call puts(@hello)
end
end