2018-11-03 18:59:24 +00:00
|
|
|
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
|
|
|
|
* *
|
|
|
|
* COMMON.MAC *
|
|
|
|
* *
|
|
|
|
* AUTHOR: NATHAN RIGGS *
|
|
|
|
* CONTACT: NATHAN.RIGGS@ *
|
|
|
|
* OUTLOOK.COM *
|
|
|
|
* *
|
2019-01-10 04:12:28 +00:00
|
|
|
* VERSION: 0.3.0 *
|
|
|
|
* DATE: 10-JAN-2018 *
|
2018-11-03 18:59:24 +00:00
|
|
|
* ASSEMBLER: MERLIN 8 PRO *
|
2018-12-15 02:23:32 +00:00
|
|
|
* LICENSE: APACHE 2.0 *
|
|
|
|
* OS: DOS 3.3 *
|
2018-11-03 18:59:24 +00:00
|
|
|
* *
|
|
|
|
*------------------------------*
|
|
|
|
* *
|
|
|
|
* 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 *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* MFILL :: FILL MEMORY BLOCK *
|
|
|
|
* MMOVE :: MOVE MEMORY BLOCK *
|
|
|
|
* BEEP :: RING MY BELL *
|
|
|
|
* DELAY :: DELAY IN MILLISECS *
|
|
|
|
* ZSAVE :: SAVE FREE ZERO PAGE *
|
|
|
|
* ZLOAD :: LOAD SAVE ZERO PAGE *
|
2019-01-10 04:12:28 +00:00
|
|
|
* MSWAP :: SWAP MEM RANGES *
|
2018-11-03 18:59:24 +00:00
|
|
|
* *
|
|
|
|
*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* MFILL :: FILL MEMORY BLOCK *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* FILL BLOCK OF MEMORY WITH *
|
|
|
|
* SPECIFIED VALUE. *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = STARTING ADDRESS *
|
|
|
|
* ]2 = LENGTH IN BYTES *
|
|
|
|
* ]3 = FILL VALUE *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* SAMPLE USAGE: *
|
2018-12-15 02:23:32 +00:00
|
|
|
* MFILL $300;#256;#0 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
MFILL MAC
|
2019-01-10 04:12:28 +00:00
|
|
|
_ISLIT ]1
|
|
|
|
_ISLIT ]2
|
2018-11-03 18:59:24 +00:00
|
|
|
LDA ]3 ; FILL VALUE
|
|
|
|
PHA
|
|
|
|
JSR MEMFILL
|
|
|
|
<<<
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* BEEP :: RING BELL X TIMES *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* RING THE STANDARD BELL. *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = NUMBER OF RINGS *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
2019-01-10 04:12:28 +00:00
|
|
|
* SAMPLE USAGE: BEEP 10 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
BEEP MAC
|
2018-11-03 18:59:24 +00:00
|
|
|
LUP ]1
|
|
|
|
JSR BELL
|
|
|
|
--^
|
|
|
|
<<<
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* MMOVE :: MOVE MEMORY BLOCK *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* MOVE A BLOCK OF MEMORY FROM *
|
|
|
|
* A SOURCE TO DESTINATION. *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = SOURCE ADDRESS *
|
|
|
|
* ]2 = DESTINATION ADDRESS *
|
|
|
|
* ]3 = NUMBER OF BYTES *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* SAMPLE USAGE: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* MMOVE $6A00;$7B00;#1024 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
MMOVE MAC
|
2019-01-10 04:12:28 +00:00
|
|
|
LDA #>]1
|
2018-11-03 18:59:24 +00:00
|
|
|
PHA
|
|
|
|
LDA #<]1
|
|
|
|
PHA
|
2019-01-10 04:12:28 +00:00
|
|
|
LDA #>]2
|
2018-11-03 18:59:24 +00:00
|
|
|
PHA
|
|
|
|
LDA #<]2
|
|
|
|
PHA
|
2019-01-10 04:12:28 +00:00
|
|
|
_ISLIT ]3
|
2018-11-03 18:59:24 +00:00
|
|
|
JSR MEMMOVE
|
|
|
|
<<<
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* DELAY :: DELAY X MILLISECS *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* DELAY FOR PASSED MILLISECS *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = NUM OF MILLISECONDS *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
2018-12-15 02:23:32 +00:00
|
|
|
* SAMPLE USAGE: DELAY #250 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
DELAY MAC
|
2018-11-03 18:59:24 +00:00
|
|
|
LDY ]1
|
|
|
|
JSR DELAYMS
|
|
|
|
<<<
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* ZSAVE :: SAVE ZERO PAGE *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* SAVE ZERO PAGE FREE AREAS *
|
|
|
|
* FOR LATER RESTORE. *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = ADDRESS TO STORE AT *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
2018-12-15 02:23:32 +00:00
|
|
|
* SAMPLE USAGE: ZSAVE $300 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
ZSAVE MAC
|
2018-11-03 18:59:24 +00:00
|
|
|
LDA #>]1
|
|
|
|
PHA
|
|
|
|
LDA #<]1
|
|
|
|
PHA
|
2018-12-15 02:23:32 +00:00
|
|
|
JSR ZMSAVE
|
2018-11-03 18:59:24 +00:00
|
|
|
<<<
|
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
2018-12-15 02:23:32 +00:00
|
|
|
* ZLOAD :: LOAD ZERO PAGE *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
|
|
|
* RESTORE PREVIOUSLY SAVED *
|
|
|
|
* FREE ZERO PAGE VALUES. *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
2018-12-15 02:23:32 +00:00
|
|
|
* ]1 = ADDR TO LOAD FROM *
|
2018-11-03 18:59:24 +00:00
|
|
|
*- -*
|
2018-12-15 02:23:32 +00:00
|
|
|
* SAMPLE USAGE: ZLOAD $300 *
|
2018-11-03 18:59:24 +00:00
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
2018-12-15 02:23:32 +00:00
|
|
|
ZLOAD MAC
|
2018-11-03 18:59:24 +00:00
|
|
|
LDA #>]1
|
|
|
|
PHA
|
|
|
|
LDA #<]1
|
|
|
|
PHA
|
2018-12-15 02:23:32 +00:00
|
|
|
JSR ZMLOAD
|
2018-11-03 18:59:24 +00:00
|
|
|
<<<
|
2019-01-09 20:12:55 +00:00
|
|
|
*
|
|
|
|
*``````````````````````````````*
|
|
|
|
* MSWAP :: SWAP MEMORY BLOCKS *
|
|
|
|
*- -*
|
|
|
|
* SWAPS THE VALUES STORE IN *
|
|
|
|
* ONE LOCATION WITH ANOTHER *
|
|
|
|
*- -*
|
|
|
|
* PARAMETERS: *
|
|
|
|
* *
|
|
|
|
* ]1 = FIRST ADDRESS *
|
|
|
|
* ]2 = SECOND ADDRESS *
|
|
|
|
* ]3 = LENGTH IN BYTES (BYTE) *
|
|
|
|
*- -*
|
|
|
|
* SAMPLE USAGE: *
|
|
|
|
* MSWAP $300;$400;#$90 *
|
|
|
|
*,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,*
|
|
|
|
*
|
|
|
|
MSWAP MAC
|
|
|
|
LDA #>]2
|
|
|
|
PHA
|
|
|
|
LDA #<]2
|
|
|
|
PHA
|
|
|
|
LDA #>]1
|
|
|
|
PHA
|
|
|
|
LDA #<]1
|
|
|
|
PHA
|
|
|
|
LDA ]3
|
|
|
|
PHA
|
|
|
|
JSR MEMSWAP
|
|
|
|
<<<
|