EASy68K  
It is currently Sat Sep 23, 2017 7:55 pm

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
PostPosted: Thu Mar 19, 2009 1:34 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1046
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. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group