Sign in to follow this  
Followers 0
NgoHoang

Division a unsigned WORD

3 posts in this topic

Dear all!

I have 2 variable Word_1 and Word_2 are usigned type, the formular is: Word_1:=Word_2/10;

Please show me how to divide a unsigned WORD? I try some cases but GX_Work2 show ERROR.

Thanks and best regard!

 

Capture.PNG

Share this post


Link to post
Share on other sites

what do you mean by "10"? is that decimal, hexadecimal or binary value? if binary just shift right one place. 

did you check instruction set for your processor?

Share this post


Link to post
Share on other sites

"Word_1 := Word_2 / 16#0A;" works fine for me when deviding Word_2 by 10 (16#0A)

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