Skip to content

Method for ... Turning magic-numbers into Descriptive Constants #2612

Answered by astrelsky
Wall-AF asked this question in Q&A
Discussion options

You must be logged in to vote

I believe this is what an Equate is for. From the documentation "An Equate associates a string with a scalar value in the program, and contains a list of addresses and operand positions that refer to this equate."

However this has a similar, yet different, problem as the one you mentioned for an enum. If the constant value is the result of more than one instruction it is not possible to apply an equate to it.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Wall-AF
Comment options

Answer selected by caheckman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants