futz
Active Member
Though I love tinkering with PICs, I sometimes hate that they're missing stuff I've come to take for granted when programming the MCUs I started out with (lovely Motorolas). No real stack (oh ya, it's there, but there's no instructions to use it properly on a 16F886). No proper 16-bit instructions or registers. Indirect addressing is limited to one register instead of being useable anywhere and everywhere. No index registers. Snivel snivel snivel! RISC machines can be a bear to program sometimes.
What's bugging me today is that I need indirect addressing badly in a subroutine, but my FSR is tied up in the ISR. I can't use it or of course the program crashes harshly the instant the ISR gets triggered while the PC is inside the subroutine.
Hmm... Maybe if I stack and unstack the FSR register inside the ISR so it's available outside the ISR... Hey! I just answered my own question!
What's bugging me today is that I need indirect addressing badly in a subroutine, but my FSR is tied up in the ISR. I can't use it or of course the program crashes harshly the instant the ISR gets triggered while the PC is inside the subroutine.
Hmm... Maybe if I stack and unstack the FSR register inside the ISR so it's available outside the ISR... Hey! I just answered my own question!
Last edited: