Z88 Developers' Notes | ||
---|---|---|
Contents | Contents of System Calls |
OS_Sr, save & restore operations
RST 20H, DEFB $6C
IN:
A = reason code: SR_SUS ($01) Save 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 = argumentsOUT, 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_PWTSR_SUS (A = $01), save user screen
IN:
-OUT, if call succeeded:
Fc = 0 IX = handle of saved screenOUT, if call failed:
Fc = 1 A = return code: RC_HAND ($08), not sufficiently room for screen in memory.Registers changed after return:
A.BCDEHL/..IY same .F....../IX.. differentSR_RUS (A = $02), restore user screen
IN:
IX = handle of previously saved screen imageOUT, if call succeeded:
Fc = 0 IX = 0OUT, if call failed:
Fc = 1 A = return code: RC_HAND ($08), screen handle was not validRegisters changed after return:
A.BCDEHL/..IY same .F....../IX.. differentSR_FUS (A = $05), free user screen (not restoring screen image)
IN:
IX = handle of previously saved screen imageOUT, if call succeeded:
Fc = 0 IX = 0OUT, if call failed:
Fc = 1 A = return code: RC_HAND ($08), screen handle was not validRegisters changed after return:
A.BCDEHL/..IY same .F....../IX.. differentSR_PWT (A = $08), page wait
IN:
-OUT, if call succeeded:
Fc = 0 A = <BACKSPACE> ($08)OUT, if call failed:
Fc = 1 A = return code: RC_ESC ($01), escape condition detected RC_SUSP ($69), process suspended or machine revived RC_DRAW ($66), process suspended or screen corrupted RC_QUIT ($67), KILL requestRegisters changed after return:
..BCDEHL/IXIY same AF....../.... differentNotes:
Although an OS_In alike call is made that returns the proper return codes on pre-emption error codes, successful keyboard output is always <BACKSPACE>.SR_RND (A = $09), random number
IN:
-Out:
DEBC = random numberNotes:
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!SR_WPD ($03) Write parameter data (mailbox)
DE = name of information type (null-terminated) DE = 0, clear mailbox BHL = extended pointer to information C = length of informationOUT:
Fc = 0, successfullRegisters changed after return:
A.BCDEHL/IXIY same .F....../.... differentNotes:
Mailboxing functionality is explained in detail in "Application Static Structures".SR_RPD ($04) Read parameter data (mailbox)
IN:
DE = name of information type (null-terminated) BHL = extended pointer to buffer for information read C = maximum size of bufferOUT, if call successful:
Fc = 0 C = actual data sizeOUT, if call failed:
Fc = 0 A = return code RC_FAIL ($16), information type is not presentRegisters changed after return:
A.B.DEHL/IXIY same .F.C..../.... differentNotes:
Mailboxing functionality is explained in detail in "Application Static Structures".