News:

  • June 09, 2026, 11:06:26 PM

Login with username, password and session length

Author Topic: Most Efficient Method of Finding the Active Stage?  (Read 7072 times)

samuelgmaurer

  • Newbie
  • *
  • Posts: 8
Most Efficient Method of Finding the Active Stage?
« on: October 05, 2013, 12:36:48 PM »
I am sure that this has been around since the begining of DL205 RLL+, but what is the most efficient method of finding the active stage?
“All truths are easy to understand once They are discovered;
the point is to discover them” - Galileo

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: Most Efficient Method of Finding the Active Stage?
« Reply #1 on: October 05, 2013, 08:06:37 PM »
Programmatically or Status in DirectSOFT?  For the latter, use Data View with the mapped V word of S bits V4xxxx (don't remember the address), BUT, DirecSOFT implements something called "aliases" for those mapped bits in V by designating the first bit of the 16 bit group, i.e. VS0, VS20, VS40, VS60, VS100, etc.  Look at the values in Data View in Binary or Hexadecimal format to see the values in a compact representation.

If you need to do it Programmatically, there is an instruction called ENCO that looks at the accumulator and tells you the bit position of the first 1 it finds.  Use LDD to load 32 bits, so do something like
LDD VS0
ENCO
OUT V2000

V2000 will have the decimal (NOT BCD) value of the stage bit address (this is GOOD).  If you look at V2000 in octal format in Data View, it will equal the exact stage bit that is ON (e.g. if the Most Significant, or 31st bit was ON, V2000 would read 31 decimal or 37 octal;  that would mean Stage 37 was the only one that was on from S0 thru S37).

Read up in the manual on ENCO on how it handles MULTIPLE bits being ON (if you have to worry about that - if you do, this mechanism might not work for you).