annotate ppc/test/bitnot.p @ 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 var x: integer;
mike@0 2 begin
mike@0 3 x := 314159265;
mike@0 4 x := bitnot(x);
mike@0 5 print_num(x); newline()
mike@0 6 end.
mike@0 7
mike@0 8 (*<<
mike@0 9 -314159266
mike@0 10 >>*)
mike@0 11
mike@0 12 (*[[
mike@0 13 MODULE Main 0 0
mike@0 14 IMPORT Lib 0
mike@0 15 ENDHDR
mike@0 16
mike@0 17 PROC MAIN 0 0 0
mike@0 18 ! x := 314159265;
mike@0 19 CONST 314159265
mike@0 20 STGW _x
mike@0 21 ! x := bitnot(x);
mike@0 22 LDGW _x
mike@0 23 BITNOT
mike@0 24 STGW _x
mike@0 25 ! print_num(x); newline()
mike@0 26 LDGW _x
mike@0 27 CONST 0
mike@0 28 GLOBAL lib.print_num
mike@0 29 PCALL 1
mike@0 30 CONST 0
mike@0 31 GLOBAL lib.newline
mike@0 32 PCALL 0
mike@0 33 RETURN
mike@0 34 END
mike@0 35
mike@0 36 GLOVAR _x 4
mike@0 37 ! End
mike@0 38 ]]*)