Stuart_Wales

Is there A Command....

7 posts in this topic

...that I could couple up e.g: 'AND' M800 to M850 instead of:

(With all 50 bits from M800 to M850 being used consecutively)


Share this post


Link to post
Share on other sites

This is the best I can suggest at the moment, if i'm reading your post correctly.

There maybe more efficient ways of achieving the required outcome, there are some pretty good mitsi programmers here.

 

Steve5963b0804d1ad_10-07-201717-12-00.jpg.aee

 

Edited by nehpets
1 person likes this

Share this post


Link to post
Share on other sites

Stuart, your example logic is an OR, not an AND.

And I agree with nehpets that moving them to a word and checking them that way is an option.

You don't really need to move them to a word.

If you wrote a compare like nehpets did but used K4M500 as the input, that is 16 bits starting at M500.  They do not need to be moved into word or double work first.

A couple compares doing 16 bits each would get you through 50 bits quick.

You could also use a double word compare and go to K8M500 which is 32 bits long.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks both! I'll give It a whirl.

Where can I read up about the 'K4/K8' command before the M500, as that sounds handy to know? What could I search to cover this as a topic?

Share this post


Link to post
Share on other sites

The 'K' + number before the M500 (or in your case M800) indicates the number of 4bit groups or 'nybbles' to action.

Example -  K4M800 would action M800 through to M815 inclusive, where as K2M800 would action M800 through M807 inc.

page.jpg

1 person likes this

Share this post


Link to post
Share on other sites

My easy way of remembering how many bits the "K" is controlling is just take it times 4. 

Example; 

K2M0 2x4=8 -M0-M7

K5M0 5x4=20 -M0-M19

K8M0 8x4=32 -M0-M31 

2 people like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now