1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-06-17 05:29:30 +00:00

Added functions to stddef module

This commit is contained in:
Curtis F Kaylor 2019-03-22 20:30:49 -04:00
parent 8aa2c972a7
commit 5289bb8717
2 changed files with 26 additions and 3 deletions

View File

@ -28,7 +28,7 @@ RESRXY: LDX TEMP1 ;Load X Index
LDY TEMP2 ;Load Y Index
RTS
;Set Destinatioon Pointer to Source Pointer
;Set Destination Pointer to Source Pointer
SETDSS: JSR GETSRC ;Get Destination Pointer
JMP SETDST ;Store in Source Pointer
@ -62,3 +62,18 @@ GETDST: LDX DSTLO
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,13 +6,17 @@
#define TRUE $FF
#define FALSE $00
/* Get Buffer Pointer *
* Returns: Y,X=Buffer address */
char getdst();
/* Get Destination Pointer *
* Returns: Y,X=Destination address */
void getdst();
char getdst();
/* Get Source Pointer *
* Returns: Y,X=Source address */
void getsrc();
char getsrc();
/* Retore Destination Pointer */
void resdst();
@ -38,6 +42,10 @@ void savrxy();
/* Save Source Pointer */
void savsrc();
/* Set Buffer Pointer *
* Args: &d - Buffer address */
void setbfr();
/* Set Destination Pointer to Source Pointer */
void setdss();