comparison keiko/lib.k @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 ! keiko/lib.c
2 ! Copyright (c) 2017 J. M. Spivey
3
4 MODULE Lib 0 0
5 ENDHDR
6
7 ! Primitives for labs 1--3
8 PROC lib.print 0 0 0
9 CONST 32
10 CONST 0
11 GLOBAL lib.print_char
12 PCALL 1
13 LDLW 16
14 CONST 0
15 GLOBAL lib.print_num
16 PCALL 1
17 RETURN
18 END
19
20 PROC lib.newline 0 0 0
21 CONST 10
22 CONST 0
23 GLOBAL lib.print_char
24 PCALL 1
25 RETURN
26 END
27
28 ! Primitives for ppc
29 PRIMDEF lib.new scratch_alloc PSI
30 PRIMDEF lib.open_in lib_open_in ISP
31 PRIMDEF lib.close_in lib_close_in VS
32 PRIMDEF lib.read_har lib_read_char VSP
33 PRIMDEF lib.print_num lib_print_num VSI
34 PRIMDEF lib.print_string lib_print_string VSP
35 PRIMDEF lib.print_char lib_print_char VSC
36 PRIMDEF lib.argc lib_argc IS
37 PRIMDEF lib.argv lib_argv VSIP
38 PRIMDEF lib.exit exit VSI