Host Engineering Forum

General Category => General Discussion => Topic started by: Dean on May 08, 2017, 04:31:53 PM

Title: SUMBITS
Post by: Dean on May 08, 2017, 04:31:53 PM
Being a neophyte to this whole thing, I often wonder about certain instructions and what their real world purpose is. This is one of them. What would you use this instruction to accomplish? I used the example in the help file, of SDT0.Seconds, and set the DATA window to show it in binary, so I get what's going on, but how is this used?
Title: Re: SUMBITS
Post by: franji1 on May 08, 2017, 08:10:08 PM
Number of alarms
Title: Re: SUMBITS
Post by: Dean on May 09, 2017, 07:33:17 AM
How would one relate this to a number of alarms?
Title: Re: SUMBITS
Post by: ADC Product Engineer on May 09, 2017, 08:24:45 AM
If you have a number of alarms that are reflected by say C0 to C10, you could use SUMBITS to know how many there are active.

Other uses might include knowing if any bit is on in a byte or word.
Title: Re: SUMBITS
Post by: Controls Guy on May 09, 2017, 09:07:31 AM
Other uses might include knowing if any bit is on in a byte or word.

I think if I wanted to do that, I'd just do an equality check with 0.
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 10:47:01 AM
I could come up with quite a few possible application uses...but...I could probably also do the same things with other Do-more instructions. I'm pretty sure the real reason it is in Do-more is because it was in DL.
Title: Re: SUMBITS
Post by: Controls Guy on May 09, 2017, 12:43:05 PM
I didn't know that!  I thought it was a new Do-More thing.  Never used it in Classic.
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 12:51:07 PM
I didn't know that!  I thought it was a new Do-More thing.  Never used it in Classic.

Maybe I imagined that. There were a number of fairly obscure and oddly named instructions that we implemented in Do-more strictly because they existing in DL, but this might not have been one. We might also have conjured it up because it sounded interesting...a "how many things are currently in this shift register or bit mask" kind of thing.
Title: Re: SUMBITS
Post by: Controls Guy on May 09, 2017, 01:06:04 PM
Well, I actually meant that I assumed it was a Do-More thing, because I didn't remember it from DLX.  Now you've got me curious, I'm going to go look.
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 01:08:01 PM
Well, I actually meant that I assumed it was a Do-More thing, because I didn't remember it from DLX.  Now you've got me curious, I'm going to go look.

I understood. I may be mis-remembering. My rememberer is out of calibration these days.
Title: Re: SUMBITS
Post by: Controls Guy on May 09, 2017, 01:09:03 PM
Yeah, I just went and checked, and it doesn't appear in the instruction help nor the instruction automatch (for a 260).
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 01:12:52 PM
Yeah, I just went and checked, and it doesn't appear in the instruction help nor the instruction automatch (for a 260).

I don't know how useful it is, but admit it, it's fun to say "SUMBITS" in your best Buford T. Justice voice. ;)
Title: Re: SUMBITS
Post by: Controls Guy on May 09, 2017, 02:12:05 PM
That's really the key factor in the entire discussion.   ;D
Title: Re: SUMBITS
Post by: Dean on May 09, 2017, 02:29:21 PM
I was discussing my question with a colleague, and actually said the word out loud for the first time this morning. This is the first thing that went through my head. :D
Quote
I don't know how useful it is, but admit it, it's fun to say "SUMBITS" in your best Buford T. Justice voice.
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 02:44:46 PM
That's really the key factor in the entire discussion.   ;D

Well...yeah. ;)
Title: Re: SUMBITS
Post by: ADC Product Engineer on May 09, 2017, 06:06:26 PM
The instruction in DirectLogic was just called SUM.

Like BobO said, there are probably better ways.  Dean asked for an example and that was just one of the first things to come to mind.
Title: Re: SUMBITS
Post by: BobO on May 09, 2017, 09:04:45 PM
The instruction in DirectLogic was just called SUM.

So my rememberer may be out of calibration, but happened to be correct this time. Broken clocks and whatnot. Cool.