|
Welcome to the EASy68K forum. This is the place to
discuss 68000 assembly language programming with EASy68K.
| View previous topic :: View next topic |
| Author |
Message |
profkelly

Joined: 16 Dec 2004 Posts: 596 Location: Monroe County Community College, Monroe Michigan, U.S.A.
|
Posted: Thu Mar 19, 2009 8:34 am Post subject: Lower case strings in macro arguments |
|
|
When passing a string as a macro argument enclose the text inside single quotes and it will retain the case.
| Code: |
*-----------------------------------------------------------
* Written by : Chuck Kelly
* Description : Demo of macros
* Macro definitions should be placed at the top of the source file.
*-----------------------------------------------------------
OPT MEX
CODE EQU 0
TEXT EQU 1
SECTION TEXT
ORG $2000
SECTION CODE
ORG $1000
* print the text string
* use ENDL as second argument to add return and linefeed
PRINT MACRO
SECTION TEXT
MSG\@ DC.B \1
IFARG 2
IFC '\2','ENDL'
DC.B $D,$A
ENDC
ENDC
DC.B 0
SECTION CODE
MOVEM.L D0/A1,-(SP)
LEA MSG\@,A1
MOVE.B #14,D0
TRAP #15
MOVEM.L (SP)+,D0/A1
ENDM
HALT MACRO
MOVE.B #9,D0
TRAP #15
ENDM
**********************
* Program Start
**********************
START
PRINT <'Macro Demonstration Program'>,ENDL
HALT Halt the program
END START
|
_________________ Prof Chuck Kelly |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|