markmiller Posted May 11 Share Posted May 11 I've tried looking around for documentation on a bit of syntax in some MADS code I'm reading, and I am stumped. Could someone interpret it? I'm talking specifically about the expression: ":>:num iny" in the following macro (5th line). .macro @ADD_BIT num bcc skip adc #<:num .if :num < $4FF :>:num iny .if :num > $4F bcc skip iny .endif .else ... .endif skip .endm Looking through the MADS manual, the closest I could get talks about :repeat, except it says that typically, a colon followed by a number refers to a parameter in a macro, if it's in decimal. Though, the inputs for @ADD_BIT are in hex. Is that line getting the high-byte of the parameter (:num) and then using that as a counter for how many times to repeat "iny"? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted May 11 Share Posted May 11 What it's doing is using the high byte of the WORD num to produce the number of repeats for the instruction "iny" So for example if num=$400 then it will produce 4 iny instructions Hope that makes sense 1 Quote Link to comment Share on other sites More sharing options...
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.
Note: Your post will require moderator approval before it will be visible.