Last active
March 22, 2021 14:29
-
-
Save moonheart08/454d10a2bd0994780cd7c15f3a268cf3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' FLAGS layout: cznhcznhcznhCZNH, where lowercase values are junk data in the form of previous flags values. | |
' Do not depend on that, it's just how this specific example comes out to work. | |
MOV INREG1, {...} ' 2 | |
MOV INREG2, {...} ' 2 | |
MOV WRVAL, TMP1 ' 2 | |
ADD WRVAL, TMP2 WZ ' 2 Compute result and Z flag. | |
TESTB WRVAL, #8 WC ' 2 Compute C flag. | |
RCZL FLAGS ' 2 Store flags, step 1. | |
TESTB WRVAL, #7 WZ ' 2 Compute N flag. | |
SETNIB TMP1, INREG1, #7 ' 2 Store lower nibble of INREG1 to top of TMP1. | |
SETNIB TMP2, INREG2, #7 ' 2 Store lower nibble of INREG2 to top of TMP2. | |
ADD TMP1, TMP2 WC ' 2 Compute H flag. | |
RCZL FLAGS ' 2 Store N/H flags. | |
_RET_ GETBYTE {...}, WRVAL, #0 ' 2 Write back to dest reg, adjusting WRVAL in place to not be a 32-bit value. | |
' 2 Then return to dispatcher. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment