home *** CD-ROM | disk | FTP | other *** search
- ; Edit version 1.01
- ;**************************************************************************
- ;**************************************************************************
- ;*** ***
- ;*** Macro library. ***
- ;*** ***
- ;**************************************************************************
- ;**************************************************************************
- ;
- ; File Name : MACROS.LIB
- ; Module Name : MUSICBOX
- ; Module Build File : MUSICBOX.ZEX
- ; Author : Edmund Cramp
- ; Creation Date : 16-Apr-1987
- ;
- ; Assembler Name : Z80ASM (SLR Systems)
- ; Linker Name : SLRNKP (SLR Systems)
- ;
- ; Ammendment Record
- ; *****************
- ; Name Date Details of Ammendment
- ; ---- ---- ---------------------
- ; Edmund Cramp 16-Apr-1987 Initial file creation
- ; Edmund Cramp 17-Apr-1987 Version macro added.
- ; Edmund Cramp 19-Mar-1988 Modified for SLR assembler/linker.
- ;
- ; Module Function
- ; ***************
- ; This is the macro library for the MUSICBOX module. It is often an
- ; advantage to place common macros in a seperate file so that they may be
- ; used in several modules. When writing a macro it is very important to
- ; document with plenty of comments - you will probably only write the macro
- ; once but will use it many times and may not always remember the input
- ; parameters and limitations. The macros below are all commented in one
- ; of two ways:-
- ; i. A text block ABOVE the macro describing its function and
- ; input/output requirments and restrictions.
- ; ii. Internal comments starting with ";;" - these will not appear
- ; in the final macro assembly listing and will not comsume
- ; memory during the actual assembly as normal ";" delimited
- ; comments would.
- ; In general macros that are used globally (within several different
- ; modules) will be placed in this module - however specialised macros that
- ; are of a more limited application should be placed with the modules that
- ; use them. This strategy will make the best use of macro table space in
- ; assemblers that keep their internal macro tables in mamory and will
- ; generally speed all assemblies. The macro "NOTE" is in this class and is
- ; placed as a "Local Macro" within the modules using it.
- ;
- ;**************************************************************************
-
- ;+
- ; Usage: STRING 'ASCII text string'
- ; Macro to take a single ASCII text string as input and append CR,LF to it.
- ; The string is then terminated with a '$' for use with the CP/M BDOS print
- ; function.
- ;-
- STRING MACRO TEXT
- DEFB TEXT,0DH,0AH,'$'
- ENDM
-
- ;+
- ; Usage: PRINT label
- ; Macro to print a '$' terminated string on the console via CP/M function 9.
- ;-
- PRINT MACRO NAME
- LD DE,NAME ;; Point to string
- LD C,9 ;; CP/M func - print terminated string.
- CALL BDOS ;; Call operating system.
- ENDM
-
- ;+
- ; Usage: VERSION
- ; Macro to generate a version number string from predefined symbol "VERSION".
- ; This symbol must have a value between 0 and 999.
- ;-
- MVERSN MACRO
- DEFB [VERSION/100]+'0'
- DEFB '.'
- DEFB [VERSION MOD 100/10]+'0'
- DEFB [VERSION MOD 10]+'0'
- ENDM
-
- ;**************************************************************************
- ;*** End of MACROS.LIB ***
- ;**************************************************************************