I agree. For me, its the simple efficiencies achieved by MPASM that I like. I am able to write code then immediately simulate it to verify that it actually WORKS. 99.9% of all code is written in ASM. The only exception are cases where complex math is needed. In those cases, I use C or Pascal to do the math, because it might take me months to develop my own code. Microchip code samples have so many errors that to use them might be fatal, but I have a high expectation that the HLL involved has carefully tested their math routines. A decent, bulletproof math unit for MPASM would be a big help... but I don't trust MC to develop one that is error-free. --Bob Axtell PAUL James wrote: > Rikard, > > I can't help you with your request, but you have brought up a point that > I have answered before. That is, > you have come across something that I have run into in the past. And it > further justifies my opinion that > HLL's for the PIC series is not the big boon that they are made out to > be. I hear people often saying that the Microchip instruction set is > "Arcane" or "Cumbersome". However, I think it is just fine. I think > the HLL's > Are the Arcane, Cumbersome ones. Therefore, I still do most of my > programming in assembler. Only if the > Customer requests an HLL be used, do I depart from my norm of assembler. > > > For me, the HLL's just aren't worth the trouble of learning. I like > assembler. If a person likes the HLL's > For the PIC series, more power to them. I can only speak for myself and > for my preferences. > > > > Regards, > > > Jim > > > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Rikard Bosnjakovic > Sent: Monday, March 03, 2008 11:50 AM > To: Microcontroller discussion list - Public. > Subject: [PIC] Mixing MPASM and C (Hi-Tech PICC) > > I've downloaded the evaluation version of Hi-Tech PIC C-compiler. > Having programmed in C earlier but never for a microcontroller, this was > going to be a tryout to see if I should switch from asm or combine it > with asm (which I happen to know pretty well at this time). > > Without having the luck of finding tutorial or crash courses for PICC, I > simply had to write some useless code just for the sake of testing the > compiler and step-debug it in the simulator: > > static int foo = 42; > > void main() { > int i = 9; > > i += foo; > return; > } > > Worked fine, compiled as it should. > > In MPLAB's manual and other places I've seen that it is possible to > combine both C and assembler. Thus having foo.asm (compiled to > foo.obj) and bar.c (compiled to bar.obj), it's possible to link them > both to the same final executable. > > But here's the problem. For the test-project, I have set the PICC to be > the language tool MPLAB should use, but when I add a .asm-file to the > project and try to "build all", the C-compiler tells me that it cannot > handle the *.asm. I thought that for these files the MPASM-program > should be run, but obviously not. I cannot seem to switch the language > tool suite for a single file, either, so I'm a bit of stuck here. > > Do you need two separate projects to be able to use separate C- and > asm-code? I'm aware that the PICC can use inline assembler and the like, > but that's currently not the option. I have only 45 days to evaluate > PICC, so I need to try every possible combination ;-) > > > -- > - Rikard - http://bos.hack.org/cv/ > -- > http://www.piclist.com PIC/SX FAQ & list archive View/change your > membership options at http://mailman.mit.edu/mailman/listinfo/piclist > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist