Hi,
As far as I am aware, when you use a hexadecimal number in assembly code it does not always represent a number.
For example,
BCLR n,M will clear bit n, in byte M:
BCLR $0007,$0001 will clear bit 7 in byte 1
However this syntax is not consistent, sometimes the hexadecimal numbers do not represent numbers, but instead represent commands.
for example
bset 7,$0004 will tell the microcontroller that bit 7 in data direction registry A is an output.
This is because the address of data direction registry A is $0004, so it put a 1 in bit 7 of DDR A. When a bit in a data direction registry is a 1 it means that the corresponding pin for port A will be an output. (and when it is a 0 it will be an input)
bset 7,$0004 will put a 1 in bit 7 of DDR A, which means that pin 7 of port A will be an output.
So my question is:
At what point do the hexadecimal numbers stop being addresses for registers and other things, and instead start to represent actual numbers.
Thanks.
As far as I am aware, when you use a hexadecimal number in assembly code it does not always represent a number.
For example,
BCLR n,M will clear bit n, in byte M:
BCLR $0007,$0001 will clear bit 7 in byte 1
However this syntax is not consistent, sometimes the hexadecimal numbers do not represent numbers, but instead represent commands.
for example
bset 7,$0004 will tell the microcontroller that bit 7 in data direction registry A is an output.
This is because the address of data direction registry A is $0004, so it put a 1 in bit 7 of DDR A. When a bit in a data direction registry is a 1 it means that the corresponding pin for port A will be an output. (and when it is a 0 it will be an input)
bset 7,$0004 will put a 1 in bit 7 of DDR A, which means that pin 7 of port A will be an output.
So my question is:
At what point do the hexadecimal numbers stop being addresses for registers and other things, and instead start to represent actual numbers.
Thanks.