From 5b734a8aa3a02c87012e90f9c97b71914c776214 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 17 Jun 2017 15:06:56 +0200 Subject: Compile --- eval.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'eval.go') diff --git a/eval.go b/eval.go index eedffd4..da962f5 100644 --- a/eval.go +++ b/eval.go @@ -27,10 +27,17 @@ func (vm *J1) Reset() { vm.rsp = 0 } +// Depth of stacks func (vm *J1) Depth() uint16 { return (uint16(vm.rsp) << 8) | uint16(vm.dsp) } -func (vm *J1) T() uint16 { return vm.st0 } -func (vm *J1) N() uint16 { return vm.dstack[vm.dsp] } -func (vm *J1) R() uint16 { return vm.rstack[vm.rsp] } + +// T is top of the data stack +func (vm *J1) T() uint16 { return vm.st0 } + +// N is sendond element in data stack +func (vm *J1) N() uint16 { return vm.dstack[vm.dsp] } + +// R is top of return stack +func (vm *J1) R() uint16 { return vm.rstack[vm.rsp] } // LoadBytes into memory func (vm *J1) LoadBytes(data []byte) error { -- cgit v1.2.3