gnupic: gpasm not expanding macros
Subject:
gpasm not expanding macros
From:
Brandon Fosdick ####@####.####
Date:
13 Jul 2001 01:19:23 -0000
Message-Id: <3B4E4C99.6533B02E@glue.umd.edu>
I have gpasm 0.9.7 installed on FreeBSD-4.3. I've tried using the "-e
ON" arguments, but no change. I also noticed that when I use macros in a
file, gpasm expands .inc files (namely p16f87.inc) in the listing
whereas if I don't use macros, the same inc files aren't expanded (but
the program still works).
Here's code snippet and list output...
The macro defined at the top pf the file:
; Send a character using the USART
; Assumes Bank0 is already set
tx_char macro _achar
call tx_wait ;Wait for previous char to leave
movlw _achar
movwf TXREG ;Send the next char
endm
And where its used:
main
movlw b'11110001' ;Output a test pattern to PORTB
movwf PORTB
;Send "Hello World!" ad infinitum
tx_char 'H'
tx_char 'e'
tx_char 'l'
tx_char 'l'
tx_char 'o'
tx_char ' '
tx_char 'W'
tx_char 'o'
tx_char 'r'
tx_char 'l'
tx_char 'd'
tx_char '!'
tx_char 0x0D ;Carriage return
tx_char 0x0A ;Linefeed
goto main
The listing:
00049 main
00050 movlw b'11110001' ;Output a
test pattern to PORTB
00051 movwf PORTB
00052
00053 ;Send "Hello World!" ad infinitum
00054 tx_char 'H'
00055 tx_char 'e'
00056 tx_char 'l'
00057 tx_char 'l'
00058 tx_char 'o'
00059 tx_char ' '
gpasm-0.9.7 alpha test4.asm 7-12-2001
21:09:03 PAGE 9
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00060 tx_char 'W'
00061 tx_char 'o'
00062 tx_char 'r'
00063 tx_char 'l'
00064 tx_char 'd'
00065 tx_char '!'
00066 tx_char 0x0D ;Carriage return
00067 tx_char 0x0A ;Linefeed
00068
00069 goto main