PIC assembly is fun, but GOTOs suck. I wrote this macro library that lets you write nested IF blocks, just like C or other languages.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Create an account to leave a comment. Already have an account? Log In.
Those nops are actually the 2nd word of the GOTO instructions. This was compiled targeting a pic18f series chip which uses 2 words (4 bytes) per GOTO so that it can support up to 2M of flash addresses. The disassembler reads the 2nd word back as a NOP. On 16f series chips GOTOs use 1 word.
There are some brach instructions in the 18f series that take 1 word, but are limited to certain relative address ranges.
Ah... The 18f.... That explains it. I've never coded in assembly for them, only C. The one's that I do assembly for have an 11bit address field + the pclath register as the destination.
But isn't there a disassembler that can generate and display properly formatted "source" for the two-byte gotos?
@matseng, I was just using the Window -> PIC Memory Views -> Program Memory, the disassembly view seems to hide labels (part of what I was trying to demo) but doesn't show any NOPs
Become a member to follow this project and never miss any updates
How come there are NOPs after every goto? I don't remember doing that the last time I wrote assembly for the 10 or 16 series - butvitcwas a few years ago so I might have forgotten all about it. ;-)