--- qemu/roms/SLOF/slof/fs/instance.fs 2018/04/24 18:59:09 1.1.1.1 +++ qemu/roms/SLOF/slof/fs/instance.fs 2018/04/24 19:26:04 1.1.1.2 @@ -1,5 +1,5 @@ \ ***************************************************************************** -\ * Copyright (c) 2004, 2008 IBM Corporation +\ * Copyright (c) 2004, 2011 IBM Corporation \ * All rights reserved. \ * This program and the accompanying materials \ * are made available under the terms of the BSD License @@ -22,6 +22,8 @@ : (create-instance-var) ( initial-value -- ) get-node ?dup 0= ABORT" Instance word outside device context!" + dup node>extending? @ 0= + my-self 0<> AND ABORT" INSTANCE word can not be used while node is opened!" dup node>instance @ ( iv phandle tmp-ihandle ) swap node>instance-size dup @ ( iv tmp-ih *instance-size instance-size ) dup , \ compile current instance ptr @@ -34,13 +36,18 @@ VOCABULARY instance-words ALSO instance-words DEFINITIONS -: VARIABLE 0 create-instance-var DOES> @ >instance ; -: VALUE create-instance-var DOES> @ >instance @ ; -: DEFER 0 create-instance-var DOES> @ >instance @ execute ; +: VARIABLE 0 create-instance-var DOES> [ here ] @ >instance ; +: VALUE create-instance-var DOES> [ here ] @ >instance @ ; +: DEFER 0 create-instance-var DOES> [ here ] @ >instance @ execute ; \ No support for BUFFER: yet. PREVIOUS DEFINITIONS +\ Save XTs of the above instance-words (put on the stack with "[ here ]") +CONSTANT +CONSTANT +CONSTANT + \ check whether a value or a defer word is an \ instance word: It must be a CREATE word and \ the DOES> part must do >instance as first thing