Quote Originally Posted by srspinho View Post
I´m doing that just because I can not find the 18F4620 here in Brazil.
They're available practically everywhere else in the world... You've obviously got internet access...Get one...

Warning[207] d:\teste_~1\nokia~2.asm 188 : Found Label after column 1. (bra)
Error[122] d:\teste_~1\nokia~2.asm 188 : Illegal opcode (clcdoverstr)
Because there isn't a 'bra' opcode in the 16F877. The 2nd error is probably a result of the first.
Change the bra to goto in the macro and see what happens...

Message[303] d:\teste_~1\nokia~2.asm 190 : Program word too large. Truncated to core size (5465)

I don´t understand why the code doesn´t fit in my 877, since the same source compiled for the 18F4620 takes less than 3 Kb...
There's a number of different reasons. 18F registers don't multiple bank bit setting instructions every time you want to access a variable, 16F's do. Every time you want to access a register in an 18F, you just access it, period. With the 16F, you have to set either 1,2, or 3 bank bits first, then you can access it. So, for every variable access with an 18F, one word, for every variable access with a 16F, could be up to 3 instructions just to get to it. (see section 2.4 of the 16F877A datasheet and/or section 5 of the 18F4620 datasheet)

16F877 or 16F877A?