mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-12-03 18:49:28 +00:00
875dd80998
- fixed a bunch of bugs - separated common and stdio libraries - commenting upgrades - created min versions of each library
181 lines
4.7 KiB
Plaintext
181 lines
4.7 KiB
Plaintext
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
|
|
* *
|
|
* COMMON.MAC *
|
|
* *
|
|
* AUTHOR: NATHAN RIGGS *
|
|
* CONTACT: NATHAN.RIGGS@ *
|
|
* OUTLOOK.COM *
|
|
* *
|
|
* VERSION: 0.1.2 *
|
|
* DATE: 30-OCT-2018 *
|
|
* ASSEMBLER: MERLIN 8 PRO *
|
|
* *
|
|
* LICENSE: APACHE 2.0 LICENSE, *
|
|
* WHERE APPLICABLE. CODE *
|
|
* INSPIRED BY OR COPIED FROM *
|
|
* OTHERS MAY FALL UNDER A *
|
|
* DIFFERENT LICENSE. I WILL *
|
|
* DO MY BEST TO NOTIFY SUCH *
|
|
* CASES. *
|
|
* *
|
|
*------------------------------*
|
|
* *
|
|
* THIS IS A MACRO LIBRARY FOR *
|
|
* COMMON.LIB, AND CAN BE USED *
|
|
* REGARDLESS OF WHETHER A *
|
|
* SPECIFIC FUNCTION IS *
|
|
* INCLUDED AS A PUT IN THE *
|
|
* MAIN SOURCE. *
|
|
* *
|
|
*------------------------------*
|
|
* *
|
|
* LIST OF MACROS *
|
|
* *
|
|
* _MFIL :: FILL MEMORY BLOCK *
|
|
* _MMOV :: MOVE MEMORY BLOCK *
|
|
* _BELL :: RING MY BELL *
|
|
* _DLAY :: DELAY IN MILLISECS *
|
|
* _ZSV :: SAVE FREE ZERO PAGE *
|
|
* _ZLD :: LOAD SAVE ZERO PAGE *
|
|
* *
|
|
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
|
|
*
|
|
*``````````````````````````````*
|
|
* _MFIL :: FILL MEMORY BLOCK *
|
|
*- -*
|
|
* FILL BLOCK OF MEMORY WITH *
|
|
* SPECIFIED VALUE. *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* *
|
|
* PARAM1 = STARTING ADDRESS *
|
|
* PARAM2 = LENGTH IN BYTES *
|
|
* PARAM3 = FILL VALUE *
|
|
*- -*
|
|
* SAMPLE USAGE: *
|
|
* _MFIL $300;#256;#0 *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_MFIL MAC
|
|
LDA #>]1 ; STARTING POINT
|
|
PHA
|
|
LDA #<]1
|
|
PHA
|
|
LDA #>]2 ; # OF BYTES
|
|
PHA
|
|
LDA #<]2
|
|
PHA
|
|
LDA ]3 ; FILL VALUE
|
|
PHA
|
|
JSR MEMFILL
|
|
<<<
|
|
*
|
|
*``````````````````````````````*
|
|
* _BELL :: RING BELL X TIMES -*
|
|
*- -*
|
|
* RING THE STANDARD BELL. *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* *
|
|
* PARAM1 = NUMBER OF RINGS *
|
|
*- -*
|
|
* SAMPLE USAGE: _BELL *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_BELL MAC
|
|
LUP ]1
|
|
JSR BELL
|
|
--^
|
|
<<<
|
|
*
|
|
*``````````````````````````````*
|
|
* _MMOV :: MOVE MEMORY BLOCK -*
|
|
*- -*
|
|
* MOVE A BLOCK OF MEMORY FROM *
|
|
* A SOURCE TO DESTINATION. *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* PARAM1 = SOURCE ADDRESS *
|
|
* PARAM2 = DESTINATION ADDRESS *
|
|
* PARAM3 = NUMBER OF BYTES *
|
|
*- -*
|
|
* SAMPLE USAGE: *
|
|
* *
|
|
* _MMOV $6A00;$7B00;#1024 *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_MMOV MAC
|
|
LDA #>]1 ; SRC ADDR
|
|
PHA
|
|
LDA #<]1
|
|
PHA
|
|
LDA #>]2 ; DEST ADDR
|
|
PHA
|
|
LDA #<]2
|
|
PHA
|
|
LDA #>]3 ; # OF BYTES
|
|
PHA
|
|
LDA #<]3
|
|
PHA
|
|
JSR MEMMOVE
|
|
<<<
|
|
*
|
|
*``````````````````````````````*
|
|
* _DLAY :: DELAY X MILLISECS *
|
|
*- -*
|
|
* DELAY FOR PASSED MILLISECS *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* *
|
|
* PARAM1 = NUM OF MILLISECONDS *
|
|
*- -*
|
|
* SAMPLE USAGE: _DLAY #250 *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_DLAY MAC
|
|
LDY ]1
|
|
JSR DELAYMS
|
|
<<<
|
|
*
|
|
*``````````````````````````````*
|
|
* _ZSV :: SAVE ZERO PAGE *
|
|
*- -*
|
|
* SAVE ZERO PAGE FREE AREAS *
|
|
* FOR LATER RESTORE. *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* *
|
|
* PARAM1 = ADDRESS TO STORE AT *
|
|
*- -*
|
|
* SAMPLE USAGE: _ZSV $300 *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_ZSV MAC
|
|
LDA #>]1
|
|
PHA
|
|
LDA #<]1
|
|
PHA
|
|
JSR ZSAVE
|
|
<<<
|
|
*
|
|
*``````````````````````````````*
|
|
* _ZLD :: LOAD ZERO PAGE *
|
|
*- -*
|
|
* RESTORE PREVIOUSLY SAVED *
|
|
* FREE ZERO PAGE VALUES. *
|
|
*- -*
|
|
* PARAMETERS: *
|
|
* *
|
|
* PARAM1 = ADDR TO LOAD FROM *
|
|
*- -*
|
|
* SAMPLE USAGE: _ZLD $300 *
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
*
|
|
_ZLD MAC
|
|
LDA #>]1
|
|
PHA
|
|
LDA #<]1
|
|
PHA
|
|
JSR ZLOAD
|
|
<<<
|