that's from a P04's 66301....
Code:
vcal_7: LB A, r0
STB A, r2
STB A, r5
label_2c1b: DEC DP
DECB r2
LCB A, [DP]
ADDB r6, A
JGE label_2c1b
DECB r2
STB A, 08eh
LB A, r6
STB A, 08fh
CLR A
LB A, r2
ADD X1, A
MOV DP, X1
CLRB A
lets look at one of the situations: r0=0x08, r1=0x-F, r7=0xC0, r6=0xA3
My bigest problem are the first three lines.....
What is "LB A, r0"???? From reading the instruction manual I came to the conclusion that r0 should hold an address. The instruction should get the byte that is stored at this address, and put the byte in A
However, r0=8

isn't that the SFR space????
ir is the above just putting 8 into A???
Also, in the label_2c1b loop we decrement r2, which cannot be anything alse than decrementing the number that is stored in the register, correct?? I thought so, but after that we do "LB A, r2" and with all those small numbers stored in r0/r2 it still doesnt make sense that r2 is used as a pointer
Please, someone explain ho i differensiate between moving one register into another and using one register as a pointer to data.....
I know that doing something like "LCB A,[X1]" will use X1 as a pointer but how about the normal L's and LB's that don't use the square brackets around operands.... Do they still work with pointers or are they just the same as "MOV A, r2"
I'm slowly advancing towards understanding the PM5/P04 and these things are just slowing me down quite badly....