1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-01 05:41:34 +00:00

Cleaned up module stddef

This commit is contained in:
Curtis F Kaylor 2019-03-24 16:29:19 -04:00
parent ddc9a5db80
commit b701f2477c
3 changed files with 41 additions and 41 deletions

View File

@ -105,17 +105,29 @@ The following functions are defined:
the setdst function, copying temp1 and temp2
to dstlo and dsthi, respectively.
addzpw(z,&n); Adds the 16 bit value &n to the zero page word
with address z.
Note: Stores the zero page address in temp3.
adddst(&n); Adds the 16 bit value &n to the destination
pointer.
Note: Calls the addzpw function, passing dstlo
as the first argument.
addsrc(&n); Adds the 16 bit value &n to the source pointer.
Note: Calls the addzpw function, passing srclo
as the first argument.
Note: This library expects the following to be defined:
the zero page variables
srclo,srchi: Source pointer
dstlo,dsthi: Destination pointer
srclo,srchi Source pointer
dstlo,dsthi Destination pointer
and the transient variables
temp0 Temporary storage
temp1
temp2
temp0,temp1,temp2 Temporary storage

View File

@ -12,7 +12,7 @@ FALSE EQU $00 ;by some Library Routines
SAVDST: JSR GETDST ;Load Destination Pointer
JMP SAVRXY ;Save X & Y Registers
;savdst() - Save Destination Pointer
;savsrc() - Save Source Pointer
SAVSRC: JSR GETSRC ;Load Destination Pointer
JMP SAVRXY ;Save X & Y Registers
@ -63,17 +63,3 @@ GETSRC: LDX SRCLO
LDY SRCHI
RTS
;Add to Destination Address
ADDDST: LDX #DSTLO ;Set Index
BNE ADDZPW ;and Execute ADDZPW
;Add to Source Address
ADDSRC: LDX #SRCLO ;Set Index and Drop into ADDZPW
;Add to Zero Page Word
ADDZPW: CLC ;Clear Carry
ADC 0,X ;Add Argument to LSB
STA 0,X ;and Save Result
BCC ADDZPX ;If Carry
INC 1,X ; Increment MSB
ADDZPX: RTS

View File

@ -6,32 +6,33 @@
#define TRUE $FF
#define FALSE $00
/* Get Buffer Pointer *
* Returns: Y,X=Buffer address */
char getdst();
/* Get Destination Pointer *
* Returns: Y,X=Destination address */
char getdst();
int getdst();
/* Get Source Pointer *
* Returns: Y,X=Source address */
char getsrc();
int getsrc();
/* Retore Destination Pointer */
void resdst();
/* Restore Destination Pointer *
* Returns: Y,X=Destination address */
int resdst();
/* Restore A, X, and Y Registers */
void resreg();
/* Restore A, X, and Y Registers *
* Returns: A,Y,X=Saved Values */
char resreg();
/* Restore X, and Y Registers */
void resrxy();
/* Restore X, and Y Registers *
* Returns: Y,X=Saved Values */
int resrxy();
/* Retore Source Pointer */
void ressrc();
/* Restore Source Pointer *
* Returns: Y,X=Source address */
int ressrc();
/* Save Destination Pointer */
void savdst();
/* Save Destination Pointer *
* Returns: Y,X=Destination address */
int savdst();
/* Save A, X, and Y Registers */
void savreg();
@ -39,15 +40,16 @@ void savreg();
/* Save X, and Y Registers */
void savrxy();
/* Save Source Pointer */
void savsrc();
/* Save Source Pointer *
* Returns: Y,X=Source address */
int savsrc();
/* Set Buffer Pointer *
* Args: &d - Buffer address */
void setbfr();
/* Set Destination Pointer to Source Pointer */
void setdss();
int setdss();
/* Set Destination Pointer *
* Args: &d - Destination address */