Pic programming problem

R

R.Lewis

Guest
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?
 
"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote in message
news:c85277$58d$1@thorium.cix.co.uk...
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.Lewis wrote:

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
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
 
R.Lewis wrote:
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

 
"Anthony Fremont" <spam@anywhere.com> wrote in message
news:jdopc.102217$NR5.99081@fe1.texas.rr.com...
"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote in message
news:c85277$58d$1@thorium.cix.co.uk...
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.
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.
 
"Rene Tschaggelar" <none@none.net> wrote in message
news:40a61091$0$702$5402220f@news.sunrise.ch...
R.Lewis wrote:

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
--
No.
It is just simply of the form
<label> EQU <expression>
 
"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote
"Anthony Fremont" <spam@anywhere.com> wrote

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.
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.
 
On a sunny day (Sat, 15 May 2004 13:27:59 +0100) it happened "R.Lewis"
<h.lewis-not this bit-@connect-2.co.uk> wrote in
<c85277$58d$1@thorium.cix.co.uk>:

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
 
On Sat, 15 May 2004 23:40:51 +1000, Al Borowski
<aj.borowski@erasethis.student.qut.edu.au> wrote:

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.
 
"Jan Panteltje" <pNaonStpealmtje@yahoo.com> wrote in message
news:c85dhm$l8q$1@news.epidc.co.kr...
On a sunny day (Sat, 15 May 2004 13:27:59 +0100) it happened "R.Lewis"
h.lewis-not this bit-@connect-2.co.uk> wrote in
c85277$58d$1@thorium.cix.co.uk>:

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
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)
 
"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote > 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)
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.
 
"Anthony Fremont" <spam@anywhere.com> wrote in message
news:OItpc.102299$NR5.89092@fe1.texas.rr.com...
"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote > 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)

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
that your source file has DOS style CR/LF's as record separators.
 
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

"R.Lewis" <h.lewis-not this bit-@connect-2.co.uk> wrote in message
news:c85277$58d$1@thorium.cix.co.uk...
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?
 

Welcome to EDABoard.com

Sponsor

Back
Top