Host Engineering Forum

General Category => DirectSOFT => Topic started by: johneguinn on June 10, 2009, 12:38:19 PM

Title: MOV Command
Post by: johneguinn on June 10, 2009, 12:38:19 PM
I am using the MOV command to copy a set of 24 words to another set of registers. I choose which which set of registers are copied from based on a selection index and this works great. My problem is copying the other way for writing to these stored variables. The MOV command does not take a variable for the destination, only the source. Any thoughts on how I can do this with out using 24 sets of LDX and OUT commands?
Thanks for your help!
John
Title: Re: MOV Command
Post by: b_carlton on June 10, 2009, 03:03:28 PM
The 205 manual does not show it but the MOV command WILL take a pointer. Try it.
Title: Re: MOV Command
Post by: franji1 on June 10, 2009, 05:23:47 PM
Since you would normally use LDA O2000, if you are using a pointer (that contains a V address) you would use LD V3000 (if the pointer was in V3000).  You would NOT do LD P3000, which is technically a pointer to a pointer.
Title: Re: MOV Command
Post by: johneguinn on June 11, 2009, 03:03:13 PM
I'm not familiar with the use of the "P" type of memory, but it seems like it is the key to my issue. I didn't find any documentation on it in the manual. Is that a pointer of some type.
What I am trying to do is:
LD k18 (length of my block, hex)
LD K800 (Source location of starting block in hex)
MOV (XXXXX) where XXXXX is the destination block start which needs to be a variable. When I enter a V1500 register for this value, It writes to V1500 plus the 23 registers after that and not using the value of v1500 as a pointer, which is correct according to the documentation.

What should I enter in for XXXXX so that that destination for the move is dynamic rather than static?
Do I enter Pxxxx? If so, how does this work?

Thanks for your help
Title: Re: MOV Command
Post by: b_carlton on June 11, 2009, 03:21:59 PM
Before you get to the LDs for your MOV command you need to calculate the pointer for the starage position. This is what we do - we typicaly store starting at V10000 since there's a big chunk there.

LD Index Number (0 = 1st record, 1 = 2nd record etc)(a binary value by the way)
MULB record length (your k18 could be here)
LDA O10000 - this gets the starting point for our table
ADDBS - adding the start of the table to the calculated offset
OUT - to some register, let's say V2000

Then the MOV command is formed as
MOV P2000 - its the same register. The 'P' says use the contents as an address.

Title: Re: MOV Command
Post by: johneguinn on June 11, 2009, 04:40:53 PM
Thanks! That did the trick.
Title: Re: MOV Command
Post by: b_carlton on June 11, 2009, 05:16:51 PM
By the way - 'Pointers' are covered in the section on "Standard RLL Instructions" in the section which covers the "Accumulator/Stack Load and Output Data" just before the LD command.

And while we're on this

The 'Bit Of Word' commands allow "Pointer To Bit of Word" which has the format PBVVVV.BIT (where 'VVVV' is the pointer register and 'BIT' is 0-15). Unfortunately the bit position is a constant just as in the standard Bit Of Word.

So if you have: LDA O3000, OUT V2000
Then STRB PB2000.0 refers to the lowest bit in V3000.
But you could INCB V2000 and address the lowest bit in sucessive words. Think of the possibilities.

One last note - the use of pointers adds about 25 microseconds to an instruction. Only use where absolutely necessary.