Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Bolt on May 23, 2023, 02:57:49 PM

Title: ALHILO not working with pointers?
Post by: Bolt on May 23, 2023, 02:57:49 PM
I re-wrote some code the other day, and added the ALHILO instruction to set my alarm bits. However, it's in a FOR/NEXT loop, and it seems to not be working as intended. If I write it as >, < ladder rungs, it works fine. Here's a screenshot showing an example of it not working, .Lo should be set.
Title: Re: ALHILO not working with pointers?
Post by: BobO on May 23, 2023, 03:13:45 PM
It's working fine for me. If you want to email your code to support, I'm happy to take a look.
Title: Re: ALHILO not working with pointers?
Post by: BobO on May 23, 2023, 04:24:21 PM
You used Level.Hi and Level.Lo where you meant to use .HiHi and .LoLo.

I guess I should blame us. As wide as these elements are with the nested structs and array refs and the display doesn't show the entire element name, it's really easy to make a mistake like this. I only caught it in the cross reference. Saw the .Hi and .Lo duplicated where clearly it should have been .HiHi and .LoLo.
Title: Re: ALHILO not working with pointers?
Post by: franji1 on May 23, 2023, 04:30:50 PM
That explains why the alarm bit trend only had 2 elements, not 4.
Title: Re: ALHILO not working with pointers?
Post by: Bolt on May 23, 2023, 06:39:11 PM
Doh, I got carried away with the nested pointer structures and copy and paste, didn't get them all straight. I guess I shoulda/coulda figured that one out myself. I was kinda ignoring the mini trend view as it presumably wasn't populating data inside the FOR loop. Thanks!