annotate 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
rev   line source
mike@0 1 ! keiko/lib.c
mike@0 2 ! Copyright (c) 2017 J. M. Spivey
mike@0 3
mike@0 4 MODULE Lib 0 0
mike@0 5 ENDHDR
mike@0 6
mike@0 7 ! Primitives for labs 1--3
mike@0 8 PROC lib.print 0 0 0
mike@0 9 CONST 32
mike@0 10 CONST 0
mike@0 11 GLOBAL lib.print_char
mike@0 12 PCALL 1
mike@0 13 LDLW 16
mike@0 14 CONST 0
mike@0 15 GLOBAL lib.print_num
mike@0 16 PCALL 1
mike@0 17 RETURN
mike@0 18 END
mike@0 19
mike@0 20 PROC lib.newline 0 0 0
mike@0 21 CONST 10
mike@0 22 CONST 0
mike@0 23 GLOBAL lib.print_char
mike@0 24 PCALL 1
mike@0 25 RETURN
mike@0 26 END
mike@0 27
mike@0 28 ! Primitives for ppc
mike@0 29 PRIMDEF lib.new scratch_alloc PSI
mike@0 30 PRIMDEF lib.open_in lib_open_in ISP
mike@0 31 PRIMDEF lib.close_in lib_close_in VS
mike@0 32 PRIMDEF lib.read_har lib_read_char VSP
mike@0 33 PRIMDEF lib.print_num lib_print_num VSI
mike@0 34 PRIMDEF lib.print_string lib_print_string VSP
mike@0 35 PRIMDEF lib.print_char lib_print_char VSC
mike@0 36 PRIMDEF lib.argc lib_argc IS
mike@0 37 PRIMDEF lib.argv lib_argv VSIP
mike@0 38 PRIMDEF lib.exit exit VSI