Assembly Language SBUFF Module - fvdhoef/aquarius-plus GitHub Wiki

SBUFF Module

This module contains routines to access and manipulate the string buffer.

  • The string buffer is 256 bytes long and can hold up to 255 characters plus a null terminator.
  • It is used for building strings of arbitrary length.
  • It is stored in the BASIC buffers page, which is temporarily mapped into bank 3 by the routines.

sbuff_create_string

Clobbers A,B,C,D

Action: Creates a BASIC temporary string from the contents of the string buffer.

  • Leaves pointer to string descriptor in FAC.

Examples: call sbuff_create_string

Creates temporary string.


sbuff_get_len

Output A,_BC: String length
Clobbers DE:

Action: Returns the current length of the string being built in the buffer.

  • The length is returned in registers A and C.

Examples:

 call sbufgetlen
 ld   (binlen),bc

Gets the length of the string and stores it in main memory.


sbuff_read_byte

Input E: Buffer offset
Output A,C: Byte read
Clobbers DE

Action: Reads a byte from the string buffer.

  • Register

Examples:

code

Explanation

routine_name

Input R:
R:
Output R:
R:
Clobbers R:

Action:

Examples:

code

Explanation

routine_name

Input R:
R:
Output R:
R:
Clobbers R:

Action:

Examples:

code

Explanation

routine_name

Input R:
R:
Output R:
R:
Clobbers R:

Action:

Examples:

code

Explanation