> so in other words, the $ symbol really means 'the current line' > not the program counter ('cause the program counter is pointing > to the next instruction) > > Note that this is assembler and sometimes CPU architecture dependent. > (not that I can think of an assembler where "jump $" is a no-op, or > a CPU that increments the PC at the end of the instruction, but I'm > pretty sure I've seen at least one of those somewhere...) I don't know if I've seen any assemblers where "[jump-operation] $" is a NOP though I have seen some where "jmp *" is a nop; one 6502 assembler I used would interpret the "*" as (address of next instruction) and "$" as (address of current instruction). I think I also once used a Z80 one that was just the opposite. There are arguments to be had for both; a "GOTO $" of one for is a spin forever or until interrupt; a "GOTO $" of the other form would be a two cycle nop. Both are potentially useful, especially on assemblers which may produce more than one word of code per line (e.g. if the assembler has a "jnz" instruction, where should the '$' point?). Of course, a good local-labeling facility can pretty much obviate the need for such things, but one has to use what one has [ducking before someone throws the "$ is the one true form of hex" back in my face]. One particularly nice assembler I used (forget which one) could accomodate local labels as follows (writing from memory): a label whose definition started with "@" would be a local label; the assembler would keep a counter of how many times each such label had been used and adjust the name by prepending a number (so the first use of "@foo" would turn into "0001@foo", the second into "0002@foo", etc. When referencing such a label, one would attach a special prefix to indicate whether one wanted the NEXT such label in the code or the PREVIOUS one. So, for example [pretending this assembler was for the PIC] the code movlw 8 movwf Count @loop: decfsz Count goto b@loop ; b@ as a prefix means to look "back" decf Count2 btfss Z goto f@done movlw 99 movwf Count2 @done: might get translated as [depending upon how many other places had "@loop" and "@done" defined] movlw 8 movwf Count @0034loop: decfsz Count goto b@0034loop decf Count2 btfss Z goto f0019@done movlw 99 movwf Count2 @0019done: This facility was much less chancy than using the "$+whatever" format, but is probably simpler for the compiler than traditional local labels. It's also much more versatile, since it can work with cut and pasted code as well as with macros. Of course, one has to be careful that one's desired targets actually exist as expected; if not wierd things may happen. Still, it's a neat approach and one I'd like to see used more often.