BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
strings1lib.c File Reference
#include "blitzlib.h"

Functions

void stringmode (void)
void strings1lib_codeinit (void)
static ULONG codeinit_c (ULONG size)
 init - allocate the string work buffer.
static void stringmode_c (const UBYTE *src, ULONG len)
 $C600 (copstring) - copy a string into the work buffer at a3.

Function Documentation

◆ codeinit_c()

ULONG codeinit_c ( ULONG size)
static

init - allocate the string work buffer.

MOVEQ #1,d1 (MEMF_PUBLIC): ALibJsr $c002 (memlib globalloc). The result is the library's init value, which $C601 (workstart) loads into a3.

Parameters
sized0: the buffer size from the compiler options
Returns
d0: the buffer

◆ stringmode()

void stringmode ( void )

◆ stringmode_c()

void stringmode_c ( const UBYTE * src,
ULONG len )
static

$C600 (copstring) - copy a string into the work buffer at a3.

Copies len bytes from a0 to a3 and terminates with 0; a3 then points to the 0. The original copies in blocks of 8 bytes plus the rest; BL_STRCOPY copies by longs where the parity of both addresses allows it, otherwise by bytes, with the same result. The compiler calls it with every data register live (stvar, makelit: no save), so the thunk keeps d0/d1; the C function uses only d0, d1, a0 and a3 (no save of its own, checked in the disassembly).

Parameters
srca0: the characters
lend0: the length - the caller's stack argument (the compiler pushes it with move.l (a0)+,-(a7) before the call and removes it later), loaded by the thunk

◆ strings1lib_codeinit()

void strings1lib_codeinit ( void )