view ppc/test/varparam.p @ 1:b683d796e07e tip basis

Added generated Keiko files
author Mike Spivey <mike@cs.ox.ac.uk>
date Mon, 10 Sep 2018 20:34:00 +0100
parents 5dd13b8deb54
children
line wrap: on
line source
(* varparam.p *)

proc one(var x: integer);
  proc two(); begin x := 37 end;
begin
  two()
end;

var y: integer;

begin
  one(y);
  print_num(y);
  newline()
end.

(*<<
37
>>*)

(*[[
MODULE Main 0 0
IMPORT Lib 0
ENDHDR

PROC _one 0 0 0
!   two()
LOCAL 0
GLOBAL _two
PCALL 0
RETURN
END

PROC _two 0 0 0
!   proc two(); begin x := 37 end;
CONST 37
LDLW 12
LDNW 16
STOREW
RETURN
END

PROC MAIN 0 0 0
!   one(y);
GLOBAL _y
CONST 0
GLOBAL _one
PCALL 1
!   print_num(y);
LDGW _y
CONST 0
GLOBAL lib.print_num
PCALL 1
!   newline()
CONST 0
GLOBAL lib.newline
PCALL 0
RETURN
END

GLOVAR _y 4
! End
]]*)