I am a newbie in assembly. A and B are 8-bit registers. How do you efficiently implement this in assembly using the instruction set of pic16f876a?
if ( A == B )
call subroutine1
else
call subroutine2
One way, i think is to XOR A and B then use bit testing for all 8 bits. But that could be long.
Another way is to XOR A and B, then add one to the result, then use DECFSZ.
if you are using MPLAB (and you probably are), you can select a block of text ot once, right-click it, and select Advanced / Comment Block. this way you can comment larg parts at once. you can of course uncomment it the same way, by using the un-comment block option.
Yup, I am using MPLAB but I am using Notepad++ to write the code.. But I didn't know there's a comment/uncomment block option in MPLAB. I just found out that there's also that option in Notepad++ for Assembly. Thanks!
Freddie Chopin, are you spanish?
I have another question, I know how to set the delay between two packets but how do you set the baud rate for USART simulation in the MPLAB?
are you one of those, who doesn't know where that country is? that's not a part of spain... actually it's quite far away...
as for USART simulation - sorry - I have not played with usart simulation yet. maybe mplab is able to guess the bps from the setting of usart module in pic.