Mike_Z
Veteran Member
I'm working on a program, using PAL8 and have come across a problem. The program is doing a calculation that results in an ASCII number being held in the AC. I then want to store the AC in a memory location at the address BUFF. The program then calc's again and the new result is to be stored in the next address of BUFF. This should occur a few times. Here is what I tried to do.
I'm using BPTR as a buff pointer. The first pass through the DCA, BPTR should be zero, the DCA should save the AC in BUFF+0. BPTR is incr'ed. The second time the DCA should save the AC in BUFF+1. But I think my trouble is that BUFF+BPTR is actually adding the addresses of BUFF and BPTR. How can I add the value held in BPTR to the address of BUFF and use it as the operand of the DCA? Thanks Mike
Code:
BUFF, "0; "0; "0;
BPTR, 0000
DCA BUFF+BPTR
I'm using BPTR as a buff pointer. The first pass through the DCA, BPTR should be zero, the DCA should save the AC in BUFF+0. BPTR is incr'ed. The second time the DCA should save the AC in BUFF+1. But I think my trouble is that BUFF+BPTR is actually adding the addresses of BUFF and BPTR. How can I add the value held in BPTR to the address of BUFF and use it as the operand of the DCA? Thanks Mike