Sign in to follow this  
Followers 0
Ramkumar

BTD instruction equivalent

2 posts in this topic

Hi,

Is there an instruction equivalent to the bit field distribute in rockwell pls, for mapping bits from one register to another

Thanks

 

Share this post


Link to post
Share on other sites

i am not aware of direct replacement but one can compose data in a number of different ways. one of them is to use mask and shift instructions. for more convoluted arrangements it is probably easier and more readable to simply pack things bit by bit using contacts and coils.

MOV D4 K4M0 ; copy 16 bits from D4 to M0..M15

then use LD/OUT to remap the M bits to some other place (M100..M115 for example) with order you like

and move it back using

MOV K4M100 D5

depending on particular CPU version other options may also exist.

and if you like, just make own function that duplicates BTD exactly

 

 

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
Sign in to follow this  
Followers 0