home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / a293_1 / !AForth_Docs_Semantics_RISCOS < prev    next >
Encoding:
Text File  |  1999-04-27  |  2.5 KB  |  38 lines

  1.  
  2. Semantics for the RISCOS Word Set
  3.  
  4.  
  5. CLI  RISCOS
  6. ( c-addr u -- )
  7. Pass the string described by c-addr u and pass it to the operating system to
  8. be processed by the CLI. The string must be null-terminated.
  9.  
  10.  
  11. CLI(  RISCOS
  12. ( "string<)>" -- )
  13. Parse the string delimited by a closing parenthesis and pass the string to the operating system. This word cannot be used in a definition, it's only intended to be used from the Forth prompt or when interpreting from a file. It is actually an alias for 'S" abc" CLI'
  14.  
  15.  
  16. ESCAPES  RISCOS
  17. ( w -- )
  18. Used for enabling and disabling the escape handler. Escapes must be disabled before starting a multitasking wimp application, but can be temporarily reenabled between calls to Wimp_Poll. If w is 0, the escape handler is disabled, and if w is -1, the escape handler is enabled.
  19.  
  20.  
  21. SYS  C  RISCOS
  22. Compilation: ( mask1 mask2 "name" -- )
  23. Parse name delimited by a space, ignoring leading delimiters. Append the execution semantics below to current the definition. name is the name of the SWI to call. Note that SWI names are case sensitive.
  24.  
  25. SYS expects two words on the stack when compiling. These words are the input register mask and the output register mask respectively. A register mask consists of 1 or 0 bits in the bottom 16 bits of the word. If bit x of mask1 is set, it mean that ARM register Rx is used for input, and correspondingly, if bit x of mask2 is set, it means that register Rx is pushed onto the data stack on exit from the SWI.
  26.  
  27. Both normal SWIs and error returning (X form) SWIs are allowed. If the X form is used, an ior code is pushed onto the stack above the output parameters. The ior code can then be THROWn or just DROPped, whatever is most appropriate.
  28.  
  29. Bit 15 of mask2 has a special meaning; when it is set, SYS pushes the ARM flags onto the stack on top of the output parameters, but below the ior code, if such is used. The flags are the N, Z, C and V flags of the ARM status register. They are shifted into the bottom four bits of the value pushed onto the stack. This action is similar to BASIC.
  30.  
  31. Execution: ( i*w -- j*w )
  32. Values are taken from the stack and put into the ARM registers starting at the lowest numbered ARM register, ie. R0 is loaded from the value most recently pushed on the stack. The same correspondence between stack items and ARM registers apply to the output parameters pushed onto the stack after executuon of the SWI.
  33.  
  34.  
  35. SYS#  C  RISCOS
  36. Compilation: ( mask1 mask2 w -- )
  37. This word is similar to SYS, but expects a SWI number, w on the stack when compiling, instead of a name.
  38.