Maker Pro
Maker Pro

Pic programming problem

R

R.Lewis

Jan 1, 1970
0
Using the latest (downloaded) MPLAB I have a problem with the assembler in
that it assumes that all equates are for registers.

e.g. the equate

FRED equ 64h

gives an error message for a 12F629 'illegal memory location' (there is no
reg at 64h in the F629).

What is wrong here?
 
A

Anthony Fremont

Jan 1, 1970
0
R.Lewis said:
Using the latest (downloaded) MPLAB I have a problem with the assembler in
that it assumes that all equates are for registers.

e.g. the equate

FRED equ 64h

gives an error message for a 12F629 'illegal memory location' (there is no
reg at 64h in the F629).

That's seems odd. You should be able to 'equ' any symbol to any 32bit
number. Tell us in what context you are using FRED. In other words
post the actual code.

When I try to do something like this:

FRED equ 3425h

movwf FRED

I get 'Invalid RAM location specified' and not 'illegal memory location'

Please post your actual code that defines FRED and where FRED is
referenced. Also make sure that your source file contains DOS CR/LF
pairs at the end of each source line. Otherwise MPLAB does strange
things.
 
R

Rene Tschaggelar

Jan 1, 1970
0
R.Lewis said:
Using the latest (downloaded) MPLAB I have a problem with the assembler in
that it assumes that all equates are for registers.

e.g. the equate

FRED equ 64h

gives an error message for a 12F629 'illegal memory location' (there is no
reg at 64h in the F629).

What is wrong here?

Wasn't there a token to tell it that data comes ?
CSEG ? DSEG ? DBLOCK ? DATA ?

Rene
 
A

Al Borowski

Jan 1, 1970
0
R.Lewis said:
Using the latest (downloaded) MPLAB I have a problem with the assembler in
that it assumes that all equates are for registers.

e.g. the equate

FRED equ 64h

gives an error message for a 12F629 'illegal memory location' (there is no
reg at 64h in the F629).

What is wrong here?

This is probably wrong, but try

fred equ h'64'

and see what happens.

Al
 
R

R.Lewis

Jan 1, 1970
0
Anthony Fremont said:
That's seems odd. You should be able to 'equ' any symbol to any 32bit
number. Tell us in what context you are using FRED. In other words
post the actual code.

When I try to do something like this:

FRED equ 3425h

movwf FRED

I get 'Invalid RAM location specified' and not 'illegal memory location'

Please post your actual code that defines FRED and where FRED is
referenced. Also make sure that your source file contains DOS CR/LF
pairs at the end of each source line. Otherwise MPLAB does strange
things.

It may well be that the message was as you stated (I am not in front of that
pc now) as I was working from memory.

The prog assembles and runs perfectly OK provided that I have no value
equates so I had to slog through the code changing all the code to the
literal numbers rather than their labels. There is no problem with anything
other than literals.

In every case the opcode using FRED (and several other similar equates) was
as (the radix is hex)

....
....
FRED EQU 64
JIM EQU 0A
....
.....
MOVLW FRED ; or JIM
SUBWF etc ;
.....
......
i.e FRED and JIM are only ever used as literals
but it will not assemble.
 
R

R.Lewis

Jan 1, 1970
0
Rene Tschaggelar said:
Wasn't there a token to tell it that data comes ?
CSEG ? DSEG ? DBLOCK ? DATA ?

Rene
--

No.
It is just simply of the form
<label> EQU <expression>
 
A

Anthony Fremont

Jan 1, 1970
0
R.Lewis said:
It may well be that the message was as you stated (I am not in front of that
pc now) as I was working from memory.

The prog assembles and runs perfectly OK provided that I have no value
equates so I had to slog through the code changing all the code to the
literal numbers rather than their labels. There is no problem with anything
other than literals.

In every case the opcode using FRED (and several other similar equates) was
as (the radix is hex)

...
...
FRED EQU 64
JIM EQU 0A
...
....
MOVLW FRED ; or JIM
SUBWF etc ;
....
.....
i.e FRED and JIM are only ever used as literals
but it will not assemble.

I don't see any problem with what you posted. The only thing I can
suggest is that you join the piclist at www.piclist.com and ask your
question there. I'm currently using MPLAB 6.10.0.0 and it seems to have
no trouble.
 
J

Jan Panteltje

Jan 1, 1970
0
Using the latest (downloaded) MPLAB I have a problem with the assembler in
that it assumes that all equates are for registers.

e.g. the equate

FRED equ 64h

gives an error message for a 12F629 'illegal memory location' (there is no
reg at 64h in the F629).

What is wrong here?
MPLAB I think
I use gpasm in Linux...
and there it works without problems, you can equ any value
You SHOULD be able to equ bit values, else the assembler is of little use.
What does the doc say (I have mplab on the machine, but cannot reboot now in
windows with it, server is online).
It worked on an older version of mplab I have here, I once tried that.
Does it do same for an other processor, say 16F84?
JP
 
M

maxfoo

Jan 1, 1970
0
This is probably wrong, but try

fred equ h'64'

and see what happens.

Al

Also...
fred equ 0x64

or better yet use the cblock directive...

cblock 0x20

fred
Larry
Curly
Moe

endc





Remove "HeadFromButt", before replying by email.
 
R

R.Lewis

Jan 1, 1970
0
Jan Panteltje said:
MPLAB I think
I use gpasm in Linux...
and there it works without problems, you can equ any value
You SHOULD be able to equ bit values, else the assembler is of little use.
What does the doc say (I have mplab on the machine, but cannot reboot now in
windows with it, server is online).
It worked on an older version of mplab I have here, I once tried that.
Does it do same for an other processor, say 16F84?
JP

I have had no previous problem (with earlier MPLAB's)
I am not (necessarily) saying it is MPLAB's fault but I am stumped at this
moment.
(I have been playing with these things since before they were Microchip when
the support (in the the UK) from GE was attrocious)
 
A

Anthony Fremont

Jan 1, 1970
0
R.Lewis said:
I am not (necessarily) saying it is MPLAB's fault but I am stumped at this
moment.
(I have been playing with these things since before they were Microchip when
the support (in the the UK) from GE was attrocious)

Perhaps you mean GI (General Instruments)? As I said earlier, make sure
that your source file has DOS style CR/LF's as record separators.
 
R

R.Lewis

Jan 1, 1970
0
Anthony Fremont said:
Perhaps you mean GI (General Instruments)?

Yes, of course, I do - when you get to my age one general is pretty much
like another

As I said earlier, make sure
 
C

Charles R. Ott

Jan 1, 1970
0
My MPASM help file says:
Table: Radix Specifications Type Syntax Example
Decimal D'<digits>'
.'<digits>' D'100'
.'100'
Hexadecimal H'<hex_digits>'
0x<hex_digits> H'9f'
0x9f
Octal O'<octal_digits>' O'777'
Binary B'<binary_digits>' B'00111001'
ASCII A'<character>'
'<character>' A'C'
'C'


Randy Ott
 
Top