% $OpenXM: OpenXM/src/kan96xx/plugin/sample.sm1,v 1.2 2000/01/16 07:55:48 takayama Exp $ %% sample.sm1 [(plugin-sample) [[$[(sample) op-code [ args ]] extension integer$] [(See plugin/sample.h for the op-code.)] [( 0 [ shared-stack ] extension )] [( Initialization.)] [( 3 [ ] extension)] [( Add two elements on the top of the shared-stack and push the)] [( result to the shared-stack.)] [(init-sample : )] [(test-sample : )]] ] putUsages /init-sample { /plugin_sample_standard_operand_stack [(StandardOperandStack)] system_variable def 100 newstack /plugin_sample_shared_stack set [(sample) 0 [plugin_sample_shared_stack]] extension } def /test-sample { plugin_sample_shared_stack setstack 1 2 pstack plugin_sample_standard_operand_stack setstack %% sync the stack pointer of shared-stack before calling sample. [(sample) 3 [ ]] extension pop %% add ( --------------------------- ) message plugin_sample_shared_stack setstack pstack plugin_sample_standard_operand_stack setstack } def