Truncated match.
PICList
Thread
'Parallax to MPlab'
1997\08\13@184230
by
David Bramham
Hi all,
I have a copy of RCV2LCD.SRC for Parallax PIC Application.I would like t
o
convert it to an MPlab ASM file .However,I have problems converting such
statements as 'csne'and 'cjb'. Does anybody have either a this program in
ASM file format or a list of conversions between the 2 codes.
Many thanks
David
1997\08\13@195119
by
Martin R. Green
|
I am doing some similar conversions for a C Compiler I am converting that
used to produce a source file for an 8051 style assembler for PIC's. The
bad news is that there are no direct conversions for the conditional jump
instructions you are looking at. The good news is all can be simulated on
a PIC, but will require at least two, and sometimes quite a few PIC
instructions. This isn't as bad as it seems since the 8051 is not a RISC
device, so the number of clock cycles used for a jump is comparable to the
8051 equivalent, it is just a lot cleaner to look at the 8051 versions than
the PIC versions. If you want to keep the clean look in you ASM files, I
suggest you write macros that convert the old compare instructions into a
sequence of PIC ones that do the same thing.
Oh, one other caveat, many of the PIC equivalents will mess up one or other
of the arguments (W or a register file).
The csxx instruction are basically "compare and skip if true" instructions.
They can be simulated simply for stuff like "csnz file":
movf file,1
btfsc STATUS, ZERO
skipee ; this is the instruction that will be skipped.
Of course STATUS and ZERO are defines for your target device.
A cjxx instruction like "cjz file, target" can be written as:
movf file,1
btfsc STATUS, ZERO
goto target ; this instruction will be skipped if file is NOT zero.
These were simple, but it gets messier when you need to use the carry flag
and the zero flag for comparisons like greater than or below. In these
cases your code will have a few btfsx instructions and maybe a few local
labels (or relative goto's) too.
This is not intended to explain the whole process (I don't have time for
that), but hopefully it will put you on the right path.
HTH - Martin R. Green
spam_OUTelimarTakeThisOuT
bigfoot.com
BTW - another gotcha is that other uC's allow direct file to file
comparisons, while with PIC's you must move one register file into W and
perform the comparison from there. It makes thing messier but it can be
done.
----------
From: David Bramham[SMTP:.....d.bramhamKILLspam
@spam@QUT.EDU.AU]
Sent: Wednesday, August 13, 1997 6:33 PM
To: PICLIST
KILLspammitvma.mit.edu
Subject: Parallax to MPlab
Hi all,
I have a copy of RCV2LCD.SRC for Parallax PIC Application.I would
like to
convert it to an MPlab ASM file .However,I have problems converting such
statements as 'csne'and 'cjb'. Does anybody have either a this program in
ASM file format or a list of conversions between the 2 codes.
Many thanks
David
1997\08\14@025029
by
wterreb
|
David Bramham <.....d.bramhamKILLspam
.....QUT.EDU.AU> wrote:
> Hi all,
> I have a copy of RCV2LCD.SRC for Parallax PIC
> Application.I would like to
> convert it to an MPlab ASM file .However,I have problems
> converting such statements as 'csne'and 'cjb'. Does
> anybody have either a this program in ASM file format or
> a list of conversions between the 2 codes.
David
I also wanted to convert for Parallax to Microchip recently and
was franticly searching for a suitable converter program. The all of
a sudden it struck me.....
You can do the entire translation with MLPAB! It works beautifully.
This is what you do...
You import the Parallax OBJ file in to memory (under File menu).
The Parallax OBJ file is also INHX8M (Intel Hex 8-bit Merged format)
format, so MPLAB has no problem importing it. Then you display the
program memory window (under Window menu). This will give you
the assembler together with line numbers and addresses. Select and
copy this to a text file and you have your assembler. You'll have
to manually edit it a bit to change the calls and goto's to labels
again, but at least you will have a 100% correctly translated file. :)
Hope this helps.
Rgds
Werner
--
Werner Terreblanche users.iafrica.com/w/we/wernerte/index.htm
EraseMEwterrebspam_OUT
TakeThisOuTplessey.co.za (work) OR wernerte
spam_OUTiafrica.com (home)
Plessey SA, PO Box 30451,Tokai 7966, Cape Town, South Africa
or at home : Suite 251, PostNet X5061, Stellenbosch, 7599
Tel +27 21 7102251 Fax +27 21 7102886 Home +27 21 8872196
------------------------------------------------------------
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...