diff --git a/interfaces/pascal/nga.inc b/interfaces/pascal/nga.inc index 9bd4a1a..d228e7e 100644 --- a/interfaces/pascal/nga.inc +++ b/interfaces/pascal/nga.inc @@ -1,5 +1,6 @@ // ******************************************************** // Copyright (c) 2016 Rob Judd +// Copyright (c) 2018 Charles Childers // Based on C version by Charles Childers et al // ISC License - see included file LICENSE // ******************************************************** @@ -11,7 +12,7 @@ const STACK_DEPTH = 32; ADDRESSES = 128; IMAGE_SIZE = 524288; - NUM_OPS = 27; + NUM_OPS = 30; {$define TOS := data[sp]} {$define NOS := data[sp-1]} diff --git a/interfaces/pascal/nga.pas b/interfaces/pascal/nga.pas index 50c515b..1de23e9 100644 --- a/interfaces/pascal/nga.pas +++ b/interfaces/pascal/nga.pas @@ -1,5 +1,6 @@ // ******************************************************** // Copyright (c) 2016 Rob Judd +// Copyright (c) 2018 Charles Childers // Based on C version by Charles Childers et al // ISC License - see included file LICENSE // ******************************************************** @@ -284,6 +285,27 @@ begin ip := IMAGE_SIZE - 1; end; +procedure inst_in(); +begin + inc(sp); + TOS := 1; +end; + +procedure inst_iq(); +begin + TOS := 0; + inc(sp); + TOS := 0; +end; + +procedure inst_ii(); +begin + inst_drop(); + write(Char(data[sp])); + dec(sp); +end; + + procedure ngaProcessOpcode(opcode : Cell); begin case opcode of @@ -314,6 +336,9 @@ begin 24 : inst_shift(); 25 : inst_zret(); 26 : inst_end(); + 27 : inst_in(); + 28 : inst_iq(); + 29 : inst_ii(); end; end;