Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Assembler?

Status
Not open for further replies.

RedCore

New Member
I'm having trouble finding newbie friendly software for compiling my .asm to a hex object file.. I think I have it all figured out.. I just need to find a simple way to compile my ASM and then use "PicFlash" to send it over to my PIC..

Any tips?
 
newbie friendly software
Hmmm... I depends on the newbie. ;)
www.microchip.com has MPLAB available for free download. It will compile your *.asm file into a *.hex file which you can then load into your PIC via your "PicFlash" programmer. Others just use the MPASM compiler directly.
 
MPASMWIN is probably more 'newbie friendly' than the full MPLAB, it's the assembler that's installed along with MPLAB (and is presumably called from within MPLAB?). You don't get a desktop icon when you install MPLAB, but it's simple to add one!.
 
Yeah, I'm going to use MPASM, seems like the best option.

Thanks for the help guys.. Much appreciated.
 
no offence but you are coding in assembler but want a noobie friendly compiler ;)
 
Perhaps your forgetting that your were once a newbie in assembler too.
Because its a complex language I should want a complex compiler? There are many things that are beginners dont need and only complicate things. IMO
 
Well for a start it's NOT a compiler, and it DOESN'T compile, it's an ASSEMBLER and it ASSEMBLES.

A compiler is for a high level language, which generally produces assembler code which is than assembled to produce the final HEX file.

As a PIC 'noobie' assembler is really the way to go, so you learn about PIC's, once you understand what you are doing, and how PIC's work, you may like to move to a high level language? - but learning assembler first will help you GREATLY when/if you do.
 
Same difference Nigel, different magnitude. Assembly is still one level above machine language, in and that it is interpreted at at least one stage before it is turned into machine code. In machine language macros don't exist and have to be hand coded unrolled. No shortcuts. Any level of language interpretaton no matter how simple is still an abstraction from the base language and should still be considered a 'compiler' Modern assemblers based on C optimized hardware are only a half stage away from C code, but they are still compiled code.
 
Who mentioned macros?, pure assembler is a one for one conversion to machine language, my first programming experiences consisted of hand assembling 6502 machine code directly to HEX from source code. Also no method of storage, each program had to entered by hand via a HEX keypad directly to RAM - lost as soon as power was removed - those were the days! :D

An assembler is really just that, it converts directly to machine code - even macros do, the first pass of the assembler simply inserts the assembler code they represent, basically a text 'search and replace'.

A compiler though creates assembler code, then an assembler converts it to machine code.
 
What about assemblers that use conditional assembly? AVRStudio uses it on it's latest compiler to make it easier to write the same code for more than one chip, different ASM is generated with various conditional statements. Sort of like a makefile in C. How many other assemblers out there use conditional assembly? Technically all of them are compilers.
 
Last edited:
While guilty of using the word assembler and compiler interchangeably, I agree with Nigel on this one. Assemblers produce a one to one conversion from a mnemonic to a binary op code. Compilers can produce up to thousands of op codes per statement. Macros are not the same as the statements used in a compiler even though they appear to operate the same way; they just copy a block of mnemonics (supplied by the programmer or library) which still have the 1 to 1 relationship to the op codes.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top