Hi all
I need a bit of help with the program below.
I have a thumwheel switch and I want to transfer the left hand three digits to a dat wod specified by the right hand digit.
The program works , but seems to transfer to the wrong data word.
for example if I have 1234 dialed up on the thumbwheel switch , 123 should be transfered to data word 4. But it actuall goes to data word 8?
The data at MW20 seems to be doubled when put into the pointer ?
Any ideas ?
thanks
//Indirect adddressing example
OPN DB 10 //open data block 10 as the resident DB
L IW 124
L W#16#F
AW
T MW 20 //left hand digit on it's own
//
L IW 124
AW W#16#FFF0
SRW 4
T MW 50 //right hand 3 digits on their own
//
//
L MW 20
SLD 4
LAR1 //put the right hand digit in the correct pointer format
//
//
L MW 50
T DBW[AR1, P#0.0] //transfers the data to the DW specified by MW20
I need a bit of help with the program below.
I have a thumwheel switch and I want to transfer the left hand three digits to a dat wod specified by the right hand digit.
The program works , but seems to transfer to the wrong data word.
for example if I have 1234 dialed up on the thumbwheel switch , 123 should be transfered to data word 4. But it actuall goes to data word 8?
The data at MW20 seems to be doubled when put into the pointer ?
Any ideas ?
thanks
//Indirect adddressing example
OPN DB 10 //open data block 10 as the resident DB
L IW 124
L W#16#F
AW
T MW 20 //left hand digit on it's own
//
L IW 124
AW W#16#FFF0
SRW 4
T MW 50 //right hand 3 digits on their own
//
//
L MW 20
SLD 4
LAR1 //put the right hand digit in the correct pointer format
//
//
L MW 50
T DBW[AR1, P#0.0] //transfers the data to the DW specified by MW20