PDA

View Full Version : Assembly Guru : Question



Archangel
- 19th May 2007, 01:59
Hello,
My question is: What assembly language, style does the PIC use?
<br>
I have a book about assembly Language for the 8088 / Z80 processors and there some very different statements fot those 2. I need to learn some assembly, so as not to stay an assembly Dummy.
<br>
Anyone have recommendations as to study material?
<br>
Thanks, JS

mister_e
- 19th May 2007, 02:06
PIC use Microchip assembler, nothing really like Z80, 8080 or else. Every datasheet state the available assembler mnemonics in.

Free online book
http://www.mikroe.com/en/books/picbook/picbook.htm

Archangel
- 19th May 2007, 05:13
PIC use Microchip assembler, nothing really like Z80, 8080 or else. Every datasheet state the available assembler mnemonics in.

Free online book
http://www.mikroe.com/en/books/picbook/picbook.htm

Thank You mister_e , I was aware of this online book, but too _ _ _ _ _ _ (pick your adjective) to print it out and use it. Now I have it printed, I will study it and , hopefully learn it's secrets! :)

Darrel Taylor
- 19th May 2007, 05:41
Anyone have recommendations as to study material?


The datasheets. The "Instruction Set" section lists each opcode and what it does.
The .ASM file generated by PBP
The .LST file generated by the assembler.
PBPPIC14.LIB / PBPPIC14.MAC
-or- PBPPIC18.LIB /PBPPIC18.MAC files. (depending on the PIC you are using)


I've looked at other PIC assembler books, and the one thing they all lack, is how to use assembly language with PicBasic Pro.
It's not the same.

I don't think I could even write a working program in straight assembly language. Mostly because I used the same list of items shown above myself, to learn ASM with PBP.

PBP, doesn't really write any ASM. Instead it converts your Basic program into a series of macros that are at a level in-between Basic and assembly language.
If you want to use ASM with PicBasic Pro, then this is the area you need to learn the most.
You can actually work at the macro level, without knowing any of the 35 opcodes that the PIC uses (a few more for 18F's).

Since you already know a lot about PBP, the easiest way will be to just create small programs. (blinky lights, or simple A/D conversions)
Compile the program with PBP then open up the .ASM file that has the same name as your program. There you can see how it converted the Basic language statements into the "Macro" language. Then make small changes to the program, and see how the macro's change.

Once you know what macros are used, you can look them up in the PBP1xPIC.LIB and .MAC files to see the actual Assembly language Opcodes used. When you come up on an opcode that you aren't familiar with, look it up in the datasheet. Since you already know what it's supposed to do (you wrote the PBP program) it makes it much easier to understand how the opcode works. Reading a book doesn't give you that "Edge".

It's also a little like an interactive book.
Instead of getting stuck because the author left something out.
You can just make another test program in PBP to see how it ends up in ASM.

I never did use anything out of those other books.
It just didn't apply to PicBasic Pro.

HTH,

T.Jackson
- 19th May 2007, 07:19
I think in years to come the only people using ASM will be Kernel programmers.

Archangel
- 20th May 2007, 03:51
[list=1]

I never did use anything out of those other books.
It just didn't apply to PicBasic Pro.

HTH,

Hi Darrel,
Hmmmmmmmn, Good to know, save my money too :), Very good thing! That is pretty much how I have learned everything else I know, keep taking it apart to see what makes it tick. I just sort of thought there might be a <font color=red>college boy</font color> way that was more expedient. At least I am familiar with this path. ThankYou for the heads up!<br> I just want to understand what programs do at the machine's level when you or Mr_e or others post assy code examples and helpers. Probably I need to get sharper with PBP before wandering into the woods . . .
Thanks again,
JS