gnupic: Thread: gpasm not expanding macros


[<<] [<] Page 1 of 1 [>] [>>]
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
Subject: Re: gpasm not expanding macros
From: Brandon Fosdick ####@####.####
Date: 13 Jul 2001 01:43:09 -0000
Message-Id: <3B4E522C.A71A3D06@glue.umd.edu>

Brandon Fosdick wrote:
> 
> 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).


Silly me, I figured it out. Apparently its very picky about not having
the endm in the first column. Why is that anyway?
Subject: Re: gpasm not expanding macros
From: Craig Franklin ####@####.####
Date: 13 Jul 2001 04:00:58 -0000
Message-Id: <3B4E740F.48FC9FF3@home.com>

gpasm-0.9.7 doesn't expand macros.  The controls are there, but the no
expansion code. 

gpasm-0.9.8ish does expand macros and while loops.  I am testing it
right now.  Hopefully, it will be released in a couple of days. 

Column one is reserved for labels.  mpasm will generate a "found an
opcode in column 1" warning.  gpasm doesn't check to see if you are
using a reserved word as a label.  I should probably put that on my
0.9.9 list ... it seems to be a common mistake.

Thanks for the comments.
   
Brandon Fosdick wrote:
> 
> Brandon Fosdick wrote:
> >
> > 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).
> 
> Silly me, I figured it out. Apparently its very picky about not having
> the endm in the first column. Why is that anyway?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.