m_genesis.kv 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
m_genesis.kv 2 ;; ;;
m_genesis.kv 3 ;; This file is part of 'M', a MIPS system emulator. ;;
m_genesis.kv 4 ;; ;;
m_genesis.kv 5 ;; (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) ;;
m_genesis.kv 6 ;; http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html ;;
m_genesis.kv 7 ;; ;;
m_genesis.kv 8 ;; You do not have, nor can you ever acquire the right to use, copy or ;;
m_genesis.kv 9 ;; distribute this software ; Should you use this software for any purpose, ;;
m_genesis.kv 10 ;; or copy and distribute it to anyone or in any manner, you are breaking ;;
m_genesis.kv 11 ;; the laws of whatever soi-disant jurisdiction, and you promise to ;;
m_genesis.kv 12 ;; continue doing so for the indefinite future. In any case, please ;;
m_genesis.kv 13 ;; always : read and understand any software ; verify any PGP signatures ;;
m_genesis.kv 14 ;; that you use - for any purpose. ;;
m_genesis.kv 15 ;; ;;
m_genesis.kv 16 ;; See also http://trilema.com/2015/a-new-software-licensing-paradigm . ;;
m_genesis.kv 17 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
m_genesis.kv 18
m_genesis.kv 19 ;-----------------------------------------------------------------------------
m_genesis.kv 20 ; Emulator Flags (kept in Flag_Reg)
m_genesis.kv 21 ;-----------------------------------------------------------------------------
m_genesis.kv 22 %define InDelaySlot 0
m_genesis.kv 23 %define RunningDelaySlot 1
m_genesis.kv 24 %define Waiting 2
m_genesis.kv 25 %define LL_Bit 3
m_genesis.kv 26 %define IsWriting 4
m_genesis.kv 27 %define ExcWasTLBNoMatch 5
m_genesis.kv 28 %define Shutdown 6
m_genesis.kv 29 ;-----------------------------------------------------------------------------
m_genesis.kv 30 ; Set a given Flag:
m_genesis.kv 31 %macro Flg_On 1
m_genesis.kv 32 bts Flag_Reg, %1 ; Set the given Flag.
m_genesis.kv 33 %endmacro
m_genesis.kv 34 ;-----------------------------------------------------------------------------
m_genesis.kv 35 ; Clear a given Flag:
m_genesis.kv 36 %macro Flg_Off 1
m_genesis.kv 37 btr Flag_Reg, %1 ; Clear the given Flag.
m_genesis.kv 38 %endmacro
m_genesis.kv 39
m_genesis.kv 40 %define Flg_GOF Flg_Off ; BTR inst also gives the old value
m_genesis.kv 41 ;-----------------------------------------------------------------------------
m_genesis.kv 42 ; Get a given Flag (into CF) :
m_genesis.kv 43 %macro Flg_Get 1
m_genesis.kv 44 bt Flag_Reg, %1 ; Read the given Flag.
m_genesis.kv 45 %endmacro
m_genesis.kv 46 ;-----------------------------------------------------------------------------
m_genesis.kv 47 ; Clear all Flags:
m_genesis.kv 48 %macro Flg_Clear_All 0
m_genesis.kv 49 xor Flag_Reg, Flag_Reg ; Clear all Flags.
m_genesis.kv 50 %endmacro
m_genesis.kv 51 ;-----------------------------------------------------------------------------
m_genesis.kv 52 ; Copy one Flag to another Flag. Uses EAX for scratch.
m_genesis.kv 53 %macro Flg_Cpy 2 ; %1 : destination Flag; %2 : source Flag.
m_genesis.kv 54 Flg_Off %1 ; Clear the Destination Flag
m_genesis.kv 55 xor eax, eax ; eax := 0
m_genesis.kv 56 Flg_Get %2 ; CF := Source Flag
m_genesis.kv 57 setc al ; AL := CF (value of Source Flag)
m_genesis.kv 58 shl eax, %1 ; Slide this bit up to destination pos.
m_genesis.kv 59 or Flag_Reg, eax ; Write the destination Flag
m_genesis.kv 60 %endmacro
m_genesis.kv 61 ;-----------------------------------------------------------------------------