I'm a newb learning about PIC and Assembler at the same time. I have the PIC Simulator IDE and also a mikroElectronika EasyPIC6 to play with. I'm reading the book by John Morton. "The PIC Microcontroller, your personal introductory course"
If I run the following code on the Pic Simulator IDE (and I assume on the real chips) it behaves differently depending on which chip I am using. The PIC16F84 will leave bits 0,1 and 2 on PORTA set. The PIC16F887 will leave only bit 2 set. So the command bcf on the later chip seems to set the bit specified and clear all the others. Could somebody explain this behaviour to me or point me to. I'm really sorry if this is very elementary.
If I run the following code on the Pic Simulator IDE (and I assume on the real chips) it behaves differently depending on which chip I am using. The PIC16F84 will leave bits 0,1 and 2 on PORTA set. The PIC16F887 will leave only bit 2 set. So the command bcf on the later chip seems to set the bit specified and clear all the others. Could somebody explain this behaviour to me or point me to. I'm really sorry if this is very elementary.
Code:
org 0
Start:
bsf STATUS, 5
movlw b'00000000'
movwf TRISA
bcf STATUS, 5
movlw b'00000011'
movwf PORTA
bsf PORTA,2
goto $
end
Last edited: