Skip to navigation

Utility routines: ResetVariable

Name: ResetVariable [Show more] Type: Subroutine Category: Utility routines Summary: Set a 16-bit in the variable workspace to 0
Arguments: X The offset from xTurnHi of the low byte of the variable to zero: * &00 = xTurn(Top Hi) * &02 = zTurn(Top Hi) * &80 = dxTurn(Top Hi) * &82 = dzTurn(Top Hi) * &8A = yVelocity(Top Hi) * &EA = xRotation(Hi Lo) * &EC = zRotation(Hi Lo) * &EE = yPlane(Hi Lo) In the case of the two 24-bit variables, X is the offset of the high byte, and we have to zero the low byte manually after the routine call
Returns: A A is set to 0
.ResetVariable LDA #0 \ Zero the X-th byte from xTurnHi STA xTurnHi,X STA xTurnTop,X \ Zero the X-th byte from xTurnTop RTS \ Return from the subroutine