Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In addition to a regular NOP, the Motorola 6809 (and possibly other 6800-series processors) has a BRN instruction: branch never. It's the opposite of BRA (branch always): it takes an 8-bit offset and ignores it, effectively making it a two-byte NOP.


On PIC microcontrollers, it's common to use a "goto $+1" instruction as a two-cycle NOP to save an instruction word (every word counts when you only have 256 words of ROM and 32 bytes of RAM). It just branches to the next instruction.

See http://www.piclist.com/techref/piclist/codegen/delay.htm


I remember that from the 6811s we programmed in school. BRN also takes more cycles to complete than a standard NOP (or 2 NOPs) since it performs some branching calculations before it ends up doing nothing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: