EASy68K Forum Index  
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Welcome to the EASy68K forum. This is the place to discuss 68000 assembly language programming with EASy68K.
Lower case strings in macro arguments

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    EASy68K Forum Index -> FAQ
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.

PostPosted: Thu Mar 19, 2009 8:34 am    Post subject: Lower case strings in macro arguments Reply with quote

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
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    EASy68K Forum Index -> FAQ All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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