-
+ A7D2BE62ABFD1319DBAFAA5F8EEDD8718C3364A59D89E89C611D0A95D04BA6D81D089E93A65853F85FF3FDD45B413C2C582CBE9E7B082E40F18F206D2CAFDBB1
m/flags.asm
(0 . 0)(1 . 61)
1098 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1099 ;; ;;
1100 ;; This file is part of 'M', a MIPS system emulator. ;;
1101 ;; ;;
1102 ;; (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) ;;
1103 ;; http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html ;;
1104 ;; ;;
1105 ;; You do not have, nor can you ever acquire the right to use, copy or ;;
1106 ;; distribute this software ; Should you use this software for any purpose, ;;
1107 ;; or copy and distribute it to anyone or in any manner, you are breaking ;;
1108 ;; the laws of whatever soi-disant jurisdiction, and you promise to ;;
1109 ;; continue doing so for the indefinite future. In any case, please ;;
1110 ;; always : read and understand any software ; verify any PGP signatures ;;
1111 ;; that you use - for any purpose. ;;
1112 ;; ;;
1113 ;; See also http://trilema.com/2015/a-new-software-licensing-paradigm . ;;
1114 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1115
1116 ;-----------------------------------------------------------------------------
1117 ; Emulator Flags (kept in Flag_Reg)
1118 ;-----------------------------------------------------------------------------
1119 %define InDelaySlot 0
1120 %define RunningDelaySlot 1
1121 %define Waiting 2
1122 %define LL_Bit 3
1123 %define IsWriting 4
1124 %define ExcWasTLBNoMatch 5
1125 %define Shutdown 6
1126 ;-----------------------------------------------------------------------------
1127 ; Set a given Flag:
1128 %macro Flg_On 1
1129 bts Flag_Reg, %1 ; Set the given Flag.
1130 %endmacro
1131 ;-----------------------------------------------------------------------------
1132 ; Clear a given Flag:
1133 %macro Flg_Off 1
1134 btr Flag_Reg, %1 ; Clear the given Flag.
1135 %endmacro
1136
1137 %define Flg_GOF Flg_Off ; BTR inst also gives the old value
1138 ;-----------------------------------------------------------------------------
1139 ; Get a given Flag (into CF) :
1140 %macro Flg_Get 1
1141 bt Flag_Reg, %1 ; Read the given Flag.
1142 %endmacro
1143 ;-----------------------------------------------------------------------------
1144 ; Clear all Flags:
1145 %macro Flg_Clear_All 0
1146 xor Flag_Reg, Flag_Reg ; Clear all Flags.
1147 %endmacro
1148 ;-----------------------------------------------------------------------------
1149 ; Copy one Flag to another Flag. Uses EAX for scratch.
1150 %macro Flg_Cpy 2 ; %1 : destination Flag; %2 : source Flag.
1151 Flg_Off %1 ; Clear the Destination Flag
1152 xor eax, eax ; eax := 0
1153 Flg_Get %2 ; CF := Source Flag
1154 setc al ; AL := CF (value of Source Flag)
1155 shl eax, %1 ; Slide this bit up to destination pos.
1156 or Flag_Reg, eax ; Write the destination Flag
1157 %endmacro
1158 ;-----------------------------------------------------------------------------