Search   
Home  Print View  

 

Software

Branch Content

Applications

Applications are programs running at the LC-81 minicomputer for doing tangible work. Most of these are written in Z80 assembly language but it could also be cross-compiled in MS-DOS PC using some superlanguage cross-compiler.

General guidelines

Applications are assembled separately from the OS, with origin in address 3000H.

You must include the header file LCCP.H which contains declaration needed to access LCCP resources. If working with virtual or real tape devices, you must also include VT.H.

LCCP services are accessed using the instruction RST 08H, as following:

    ld  a, service-number
    ld  b, function-number
    rst 08H

Correct service-numbers and function-numbers are declared in LCCP.H.

Required parameters (service/function dependent) must be passed in the Stack according to a well defined "arguments frame".

To access peripherals, use the DEVMAN service. You will need to build a request struct (REQ) in application's area and pass a pointer in the arguments frame.

For error handling, use the following macros:

    SETERR (error-code) ; Report error and continue
    PANIC  (error-code) ; Report error and halt
    GETERR              ; Return current error in register A
    CLRERR              ; Clear error

error-codes are 8-bit numbers. Some are defined in LCCP.H. You can add your own application-specific error codes if necessary.

Never include the file UTILS.ASM, intended for LCCP internal use, because references to addresses  in that code are subject to change as LCCP grows. Similarly, never read or write the ERRORCODE variable directly; by doing that you would bypass LCCP functionality regarding error handling.

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