2

I have a file with a name like xxxx.asm

in it I have:

InitPORTA MACRO

pic-as throws a syntax error on this line. The code compiled fine with:
mpasmx -rdec pic-code.s
I thought *.asm files were the file type that pic-as took to mean assembly with no C contructs in them and would thus assemble them as the older assembler did.
Is there something obvious I missed?

Mike
  • 2,146
  • 1
  • 14
  • 29
Ken Smith
  • 234
  • 1
  • 7
  • for pic-as you nedd `*.s` files and not `*.asm` files. – Mike Apr 27 '21 at 04:50
  • Also consider what file encoding is being used on the source file. Could be that the assembler is expecting a different type. – rdtsc Apr 27 '21 at 12:16

2 Answers2

1

It seems to be a bug in pic-as
InitPortA(space)(space)---(space)MACRO
made the syntax error happen. Replacing the white spaces with a press of the tab key made that line compile. It seems that not all white spaces are taken as the same thing
This has become moot for me because I rolled back to v5.35 and mpasmx. I think it is better to finish my project with that version. I saw reports on line that suggested that pic-as is quite buggy. Perhaps my issue was one of the bugs.

Ken Smith
  • 234
  • 1
  • 7
  • 1
    What _exactly_ is '(space)(space)---(space)'? Please show your actual source code text, using the 'code sample' tag. – Bruce Abbott Apr 27 '21 at 07:03
  • At about line 3 of my initial question is a copy-and-paste of the line of text from the source file. My '(space)(space)---(space)' represents some number of presses of the space bar that I don't know. I didn't keep the original so how many it was would be an estimate. The word "MACRO" was aligned at column 16 so 7 would be the number of spaces. – Ken Smith Apr 28 '21 at 14:09
  • Maybe edit your answer with the – Mike Apr 29 '21 at 04:53
1

MPASM and pic-as are using different file types:
MPASM: *.asm files
pic-as: *.s files

Please remember, there are a lot more differences between these assembler types. See this document for the details.

Mike
  • 2,146
  • 1
  • 14
  • 29