Sign in to follow this  
Followers 0
pszczepan

Macro - bit value indexing

7 posts in this topic

Hi I have FOR.. NEXT Loop On the left there is a macro definition, at the right is a simulator The question is - why $SW27 after 6 loops has value 28 when it started from 10 and it has 2 increase. For me it should be 22. Thanks for clue. Edited by pszczepan

Share this post


Link to post
Share on other sites
You have set the starting value of $SW27 to H10 which is has a decimal value of 16 so incrementing by 2 six times = 28

Share this post


Link to post
Share on other sites
Thanks for answer. Anyway I have still problem with 6th loop. If I set H10 for a first loop I get value in W10 next is H10 + 2 (H12) and value is for W12 next H12 +2 (H14) value is for W14 next H14 +2 (H16) value is for W16 next H16 +2 (H18) value is for W18 next H18 +2 (it is not 20 - it is 1A) but I want to get value for W20. How I have to implement it - I cannot find solution ?

Share this post


Link to post
Share on other sites
Hello My suggestions: 1. Don't use Hex 2. Check the index registers are ticked and that BINARY is selected (not BCD) This works on the simulator. Pp

Share this post


Link to post
Share on other sites
Where can I find this option "index registers are ticked and that BINARY is selected (not BCD)". I found that, but all the time I have here binary thanks Edited by pszczepan

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