Search   
Home  Print View  

 

Software

Branch Content

Passing Parameters

Parameters between application programs and LCCP are passed in three ways:

  * Registers A and B (only)
  * Stack
  * Request struct (REQ)

Registers A and B are used when requesting services via RST 08H (A=service number, B=fuction number) as we shall see later in this section. This is the only place where registers are used for passing parameters to LCCP, and no register other than A and B are used for this purpose.

The Stack is used for passing other parameters to the service being called, if required, and to return parameters from the service back to the program. The arguments frame in the Stack is service/function dependent. The Program is responsible for clearing the arguments frame from the stack once the service has returned.

The Request Struct (REQ) is used to pass parameters to device drivers. The struct per se is allocated by the program in its memory area, then a pointer is passed in the device's entry in DEVTAB. We will cover this in details later in this section.

LCCP never uses shadow registers so application programs can safely make use of them for their own purposes.

LC-81 Homebrew Minicomputer -- this software is based on Help Books running at melissa