[BACK]Return to sample.sm1 CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / plugin

File: [local] / OpenXM / src / kan96xx / plugin / sample.sm1 (download)

Revision 1.1, Fri Oct 8 02:12:05 1999 UTC (24 years, 8 months ago) by maekawa
Branch: MAIN

Initial revision

%% 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