Hi
, about Assembler, you must know that Assembler programming for Common Personal Computer is much more dificult and complex than to these tiny uC's / uP's so that is just a relief
.
The major diference from all the other languages is that in Assembler (to uC's/uP's) you have very few processor instructions thus it's very easy to even memorise them all.
Because the Assembler is the most basic language ever developed, so as you must imagine everything that makes the other languages great is lacking here ex.
In Basic behinde one simple FUNCTION you probablly have dozens, hundreds or even more ASM instructions !!
In C things are more balanced, each C function is converted to ASM by the linker, and then the ASM Compiler compiles the C Converted ASM code to Binary ex.
In ASM you have no linker :
ASM -> Machine Code (01010101011)
but in C:
C -> Linker -> ASM -> Machine Code (01010101011)
Since Visual Basic is private property of Microsoft, they don't give the Linker/Compiler to anyone so you can't even see that process with Non-Free Languages.
Assembler (ASM) is the closest language from the Machine (010101010), lol, can you imagine being programmig with 0 and 1's ?? lololol Confusing no ? lololol, The Assembler simply atributes the code from the processor instruction (ex. 0011 0001) to a Easy to remember name (ex. movlw).
Basicaly all other languages can generate ASM code since all binaries can be disassembled into ASM code again.
Another diference is that you don't have types of variables defined here, you have the equates that are referênces to MEMORY ADRESSes.
That requires that before making those EQUATES you take some time to build the memory adresses map, so that you know where the memory is used or not, to use your variable ou contact with the device ones.
Here you MUST do that stuff with the memory or else you will be having problems with the values you store.
Ex. a Char in C lang takes 1 Byte b'00000000'
X -> 1000 'This coud start in any free to use adress (ex. at 1000)
Y -> 1008 'But this should be next like this
Well, Y is 1 Byte next X, get it ! 8)
The Bad example is:
X -> 1000 'Assuming that X is a char
Y -> 1004 'lol, this overlaps the Y with X
Then you give some val to X
X <- 3 - b'00000011'
and to Y
Y <- 3 - b'00000011'
because of the over lapping
X is 51 - b'00110011'
, lol
.
You can use this to your favor, but by mistake that could make you find program errors when the program is fine !! Keep this in mind.
That is not a rule, but if you whant to use many equates, keep the memory organised with the memory map.
This might seem strange at the first look, but when you undertaind this and some other concepts in ASM you will be programming with much ease.
I also program in C++ and V. Basic.net, but you must know that any C compiler for these devices, usualy generate to many ASM instructions because the ones that build the compiler didn't knew what will you be using (device) or what will you do with the program, so they give many ASM instructions to ensure that the code will be executing well.
My advice is that if you whant to program small memory Devices such as PIC 16F84* you will need ASM to ensure the program won't eat all the device space
, that happens when you build big programs in C, or too many functions.
* (now there is a newer version of this one, search in this forum)
If you will use the bigger devices such are the beautifull PIC 18F6720 or even 18F8720 (with external memory) you can use C with no major problems
.
But remeber that in C any Function or too many Loops generate many ASM instructions.
Try ASM if you like it stay some time to get used if not move to C.
(Did i wrote too mutch ? lol)