Jump to content
  • 0

Access single bytes of variables (Millfork vs Prog8)


SplitSpine
 Share

Question

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).

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use