SplitSpine Posted July 27, 2021 Share Posted July 27, 2021 Hello programmers of Millfork and Prog8. I have now used a lot of time to see if Prog8 has this Millfork function: Quote You can access single bytes of variables by using the following notations: for 2-byte-sized variables: .lo for the least significant byte and .hi for the most significant byte for larger variables: .b0 for the least significant byte and then .b1, .b2 and so on You can also access words that are parts of variables: for 3-byte-sized variables: .loword is the word formed from .b1 and .b0 and .hiword is the word formed from .b2 and .b1 for 4-byte-sized variables: .loword is the word formed from .b1 and .b0 and .hiword is the word formed from .b3 and .b2 I want to extract just one byte from a word variable and I just can't seem to figure it out in Prog8. Is it possible? PS I'm still deciding which languages I want to use, Prog8 or Millfork (maybe I should make a Prog8 VS Millfork thread). Quote Link to comment Share on other sites More sharing options...
0 SplitSpine Posted July 27, 2021 Author Share Posted July 27, 2021 Seems you can, I got this from mesi on Prog8's Github: Quote Yes, with built-in functions lsb and msb: byte look_lo = lsb(mydata) byte look_hi = msb(mydata) I will go and try that 1 Quote Link to comment Share on other sites More sharing options...
Question
SplitSpine
Hello programmers of Millfork and Prog8.
I have now used a lot of time to see if Prog8 has this Millfork function:
I want to extract just one byte from a word variable and I just can't seem to figure it out in Prog8.
Is it possible?
PS I'm still deciding which languages I want to use, Prog8 or Millfork (maybe I should make a Prog8 VS Millfork thread).
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.