Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleRST 20H, DEFB $6C
IN:
     A = reason code:
     SR_SUS ($01)   Save user screen
	 SR_RUS ($02)   Restore user screen
     SR_WPD ($03)   Write parameter data (mailbox)
     SR_RPD ($04)   Read parameter data (mailbox)
     SR_FUS ($05)   Free user screen
     SR_CRM ($06)   Remove card (not implemented)
     SR_CIN ($07)   Insert card (not implemented)
     SR_PWT ($08)   Page wait
     SR_RND ($09)   Occasionally a random number
(system
use)       BC, DE, HL, IX = arguments
OUT, if call successful:
     Fc = 0
     returned values depend on A(in)

OUT, if call failed:
     Fc = 1
     A = error code:
          RC_UNK ($03), unknown request
          RC_BAD ($04), bad arguments
          RC_HAND ($08), bad handle
          RC_ROOM ($07), no room
          RC_ESC ($01), with SR_PWT
          RC_SUSP ($69), with SR_PWT
          RC_DRAW ($66), with SR_PWT
          RC_QUIT ($67), with SR_PWT 

...

The return value (random number) only changes when certain operating system functions occur in between calls to OS_Sr. Repeated fetching a random number may well result in the same value being returned!.

Fixed and improved since OZ 5.0 using an xor-shift algorithm.

SR_WPD

Code Block
languagenone
titleSR_WPD ($03) Write parameter data (mailbox)
IN:
     DE = name of information type (null-terminated)
     DE = 0, clear mailbox
     BHL = extended pointer to information
     C = length of information

OUT:
     Fc = 0, successful

Registers changed after return:
     A.BCDEHL/IXIY same
     .F....../.... different

...

Mailboxing functionality is explained in detail in Application Static Structures.