From Assembly to C

nsaspook

Joined Aug 27, 2009
13,086
PICs arent really great with bits either. You cant set/reset a bit by index.
I think since the 80386 x86 can do it actually.
Its of course a pain and quite slow to load the bitnumbers via pointers, then manipulate the data with masks.
But if you want to use random IO assignment, you need the tables anyway.
I just said this today: "The PIC16/18 architecture is archaic, strange and full of gotchas but it's simple." All this is OK because a great deal of time and effort has been spent into making the same buggy architecture faster and faster, use lower power, be as cheap as possible and still be able to run (with a few tweaks) programs that were designed in the 90's.

I was hacking assembly on super-mini computers in the 80's to find and fix bugs in OS (completely written in a very CISC assembly instruction set that would make the x86 look like a PIC) code so I have good idea of what's possible using with good hardware. Was completely burned out on ASM programming then and have not looked back with fondness.
http://www.textfiles.com/bitsavers/pdf/harris/brochures/Harris_500_brochure_Jan80.pdf
I know this machine seems like nothing now but this was 1979.
 
Last edited:

Art

Joined Sep 10, 2007
806
C is useful for moving programs or functions between mcu and bigger mobile or desktop platforms,
so I wouldn’t write it off.

I was talking about transition from asm to C. Yes in C, write in C, but to move a program,
from asm to C, it has helped me to think in BASIC while doing so.
You can interpret asm as BASIC, and write the same functionality into C directly in BASIC using C syntax much of the time.
Some things like lookup tables are handled differently, like you need to declare an array, populate it, and index it yourself,
but you could call that a lookup table.

A hinderance to that general process is bitwise operations.

I am not saying C programmers should do that, or that it’s the same porting a program from C to something else.
If the C programmer used a pointer or structures for example, it’s more a C program in the first place.
 

Thread Starter

Eric007

Joined Aug 5, 2011
1,158
Btw, how do you clean a breadboard? Most of my breadboards are very dirty as I never removed the components from them. Some of the components legs are broken and I can pull them out. Is there some appropriate liquid to clean breadboard with?
 

JohnInTX

Joined Jun 26, 2012
4,787
I just said this today: "The PIC16/18 architecture is archaic, strange and full of gotchas but it's simple." All this is OK because a great deal of time and effort has been spent into making the same buggy architecture faster and faster, use lower power, be as cheap as possible and still be able to run (with a few tweaks) programs that were designed in the 90's.
Indeed! And I feel like I'm being watched... This weekend I ported some mid 90's client code written for the 16F84A to 16F1826 in about an hour and a half. I feel kind of like I'm wasting a lot of cool on-board stuff but its 1/4 the cost of the '84 and has excellent debugging support. If the client was up for a board rev, I could replace most of the analog on the board with on-board analog - for free. PIC is goofy but you can't argue with the installed cost..

Re: the Harris. I returned to college in the late 80's after doing lots of microcomputer stuff in assembler. Assembler at that school was taught on the IBM 370. It was - different. The PIC datasheets tout a simple (only 35!) instructions to learn as an advantage. I kind of miss the native double precision floating point divide in 370 assembler..

I use compressed air, and thin tweezers, to clean my breadboards.
Be careful with that. Air through a hose can pick up a big static charge that can zap chips. (Ask me how I know that). They sell air nozzles with ion-generators that neutralize the charge for just that purpose.
 
Last edited:

JohnInTX

Joined Jun 26, 2012
4,787
How do you know that?
Way back in the early 80s I blew off a few dusty boards that used 8748 uCs (windowed EPROM) and blew all of the processors. A chat with Intel revealed that I didn't know enough about ESD protection and that dry, compressed air could carry enough charge to zap the chips. We bought some ionizer nozzles.

Later, my wife managed the PCB manufacturing operation for a large medical equipment supplier and learned all about all of that. After that, I just asked her :)
 
Top