Yup, the ASM produced by PBP looks a little strange but that is it.
If you take the ASM from PBP and compile it in MPLAB it will make a HEX.
Yup, the ASM produced by PBP looks a little strange but that is it.
If you take the ASM from PBP and compile it in MPLAB it will make a HEX.
Dave
Always wear safety glasses while programming.
That isn't the way a Human writes an assembler program.
To get a useful assembler source code, download ICprog for free here:
http://www.ic-prog.com/
Open your hex file and select "assembler" under the "View" tab.
It only works for 16 family devices (I think) I can guarantee it works with
16F84/A, 16F628/A, 16F876, 16F877 hex codes.
You'll notice you can only directly look at logic operations such as IF-THEN
statements, NEXT-FOR loops, maths operations, etc.
If you use any functional commands such as SOUND, LCDOUT, I2CREAD, etc.
PBP inserts the code/libs for these commands at the start of the assembler source,
and then each PBP command calls that code.
For example, if you use the SERIN command three times in your PBP program,
the assembler serial code is only inserted once (a simple routine that receives one byte),
and the program calls that routine to receive every byte (around the areas of the program
that each SERIN command was).
You can save memory there because PBP uses some unnecessary "transporter variables" to
deliver values to these libraries. With some study, in assembler, you can use them directly.
Cheers, Art.
Last edited by Art; - 12th January 2010 at 00:29.
Hi,
After first trials with PBP I also checked ASM-file made by PBP and I was very puzzled. Then I found this old thread (asm and pbp), which explained these strange strings (list of macros).
BR,
-Gusse-
Thanks guys,
I know how the toolchain works, PBP compiles to ASM (sort of) and MPASM assembles that file creating a .hex file. I was hoping I somehow could get an ASM file containing only what will actually get assembled after all the assembler directives etc have been parsed/evaluated and the macros "called" have been replaced with the actual ASM code.
Oh well, the routines I'm trying to figure out here are fairly simple, like in the example I posted. Between the ASM, LST and MAC files I think and hope I can figure it out.
Darrels wonderful interrupt routines saves all the PBP system variables and in my case that just takes too much time. So, I'm trying to figure out what variables are being used by my routines so I can save those and only those.
Disassembling the hex file won't do me much good as I then have lost all variable names etc.
Thanks!
/Henrik.
That's not very imaginative. Add this to your PicBasic code and disassemble it:Disassembling the hex file won't do me much good as I then have lost all variable names etc.
and it will be easy to find in the assembler code, even if it is renamed.Code:@ nop @ nop @ nop Variable_Name = Variable_Name @ nop @ nop @ nop
Art.
Bookmarks