Class CodeMark
- java.lang.Object
-
- io.github.applecommander.bastools.api.code.CodeMark
-
public class CodeMark extends java.lang.ObjectACodeMarkmarks a dynamic address within the output stream. When referenced, it will report the most recent address is knows, forcing the generation to run multiple times until it "settles".Multiple passes occur for the following reasons:
- an assembly address can be calculated on the second pass (1st is to actually calculate address and 2nd pass is to use that address).
- Applesoft BASIC encodes the address as text; that means first pass, the address is "0" but 2nd pass the address is likely to be 4 digits "8123" (for example) which, in turn moves anything after that point, requiring a 3rd pass to push everything out (and likely making that number become "8126" since going from 1 digit to 4 digits adds 3 bytes to the preceding bytes
-
-
Constructor Summary
Constructors Constructor Description CodeMark()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAddress()booleanupdate(GeneratorState state)Update the current address based on theGeneratorState.
-
-
-
Method Detail
-
getAddress
public int getAddress()
-
update
public boolean update(GeneratorState state)
Update the current address based on theGeneratorState.- Returns:
- boolean indicating if the address changed
-
-