The dollar sign ($) indicates the value of the active segment's location counter.
When you use the location counter symbol, keep in mind that its value changes with each instruction, but only after that instruction has been completely evaluated.
If you use $ in an operand to an instruction or a directive, it represents the code address of the first byte of that instruction.
In your case the code loops back to the first byte of the "djnz R2,$" instruction as long as R2 is not zero.
Clear ?
Edit: Please note that this is valid for the ASM51 assembler.
If you use another assembler, it could mean something else... ...
When you use the location counter symbol, keep in mind that its value changes with each instruction, but only after that instruction has been completely evaluated.
If you use $ in an operand to an instruction or a directive, it represents the code address of the first byte of that instruction.
In your case the code loops back to the first byte of the "djnz R2,$" instruction as long as R2 is not zero.
Clear ?
Edit: Please note that this is valid for the ASM51 assembler.
If you use another assembler, it could mean something else... ...
Last edited: