Masks = {
    "0x0" : {"N" : 0b00000011111111111111111111111111}, # l.j N
    "0x1" : {"N" : 0b00000011111111111111111111111111}, # l.jal N
    "0x3" : {"N" : 0b00000011111111111111111111111111}, # l.bnf N
    "0x4" : {"N" : 0b00000011111111111111111111111111}, # l.bf N
    "0x5" : {"K" : 0b00000000000000001111111111111111}, # l.nop K
    "0x6" : {"rD": 0b00000011111000000000000000000000,  # l.movhi rD K
             "op": 0b00000000000000010000000000000000,  # l.macrc rD
             "K" : 0b00000000000000001111111111111111},
    "0x8" : {"op": 0b00000011111000000000000000000000,  # l.sys K; l.trap K
             "K" : 0b00000000000000001111111111111111}, # l.msync; l.psync; l.csync
    "0x9" : {},                                         # l.rfe
    "0xa" : {"rD": 0b00000011111000000000000000000000,  # lv.all_eq.b rD, rA, rB 
             "rA": 0b00000000000111110000000000000000,
             "rB": 0b00000000000000001111100000000000,
             "op1": 0b00000000000000000000000011111111,
             "op": 0b00000000000000000000000011110000},
    "0x11" : {"rB": 0b00000000000000001111100000000000}, # l.jr rB
    "0x12" : {"rB": 0b00000000000000001111100000000000}, # l.jalr rB
    "0x13" : {"rA": 0b00000000000111110000000000000000, # l.maci rA, I
              "I" : 0b00000000000000001111111111111111},
    "0x1b" : {"rD": 0b00000011111000000000000000000000, # l.lwa rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000000000000011111111},
    "0x1c" : {},                                        # l.cust1
    "0x1d" : {},                                        # l.cust2
    "0x1e" : {},                                        # l.cust3
    "0x1f" : {},                                        # l.cust4
    "0x20" : {"rD": 0b00000011111000000000000000000000, # l.ld rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111},
    "0x21" : {"rD": 0b00000011111000000000000000000000, # l.lwz rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111},
    "0x22" : {"rD": 0b00000011111000000000000000000000, # l.lws rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x23" : {"rD": 0b00000011111000000000000000000000, # l.lbz rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x24" : {"rD": 0b00000011111000000000000000000000, # l.lbs rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111},
    "0x25" : {"rD": 0b00000011111000000000000000000000, # l.lhz rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x26" : {"rD": 0b00000011111000000000000000000000, # l.lhs rD, I(rA)
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x27" : {"rD": 0b00000011111000000000000000000000, # l.addi rD, rA, I
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111},
    "0x28" : {"rD": 0b00000011111000000000000000000000, # l.addic rD, rA, I
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x29" : {"rD": 0b00000011111000000000000000000000, # l.andi rD, rA, K
              "rA": 0b00000000000111110000000000000000,
              "K" : 0b00000000000000001111111111111111}, 
    "0x2a" : {"rD": 0b00000011111000000000000000000000, # l.ori rD, rA, K
              "rA": 0b00000000000111110000000000000000,
              "K" : 0b00000000000000001111111111111111}, 
    "0x2b" : {"rD": 0b00000011111000000000000000000000, # l.xori rD, rA, I
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111},
    "0x2c" : {"rD": 0b00000011111000000000000000000000, # l.muli rD, rA, I
              "rA": 0b00000000000111110000000000000000,
              "I" : 0b00000000000000001111111111111111}, 
    "0x2d" : {"rD": 0b00000011111000000000000000000000, # l.mfspr rD, rA, K
              "rA": 0b00000000000111110000000000000000,
              "K" : 0b00000000000000001111111111111111},
    "0x2e" : {"rD": 0b00000011111000000000000000000000, # l.slli rD, rA, L
              "rA": 0b00000000000111110000000000000000,
              "op": 0b00000000000000000000000011000000,
              "L" : 0b00000000000000000000000000111111},
    "0x2f" : {"rA": 0b00000000000111110000000000000000, # l.sfeqi rA, I
              "I" : 0b00000000000000001111111111111111,
              "op": 0b00000011111000000000000000000000},
    "0x30" : {"rA": 0b00000000000111110000000000000000, # l.mtspr rA, rB, K
              "rB": 0b00000000000000001111100000000000,
              "K1": 0b00000011111000000000000000000000,
              "K2": 0b00000000000000000000011111111111},
    "0x31" : {"rA": 0b00000000000111110000000000000000, #l.mac rA, rB
              "rB": 0b00000000000000001111100000000000,
              "op": 0b00000000000000000000000000000011},
    "0x32" : {"rD": 0b00000011111000000000000000000000, # lf.add.s rD, rA, rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "op": 0b00000000000000000000000011110000,
              "op1": 0b00000000000000000000000011111111},
    "0x33" : {"I1": 0b00000011111000000000000000000000, # l.swa I(rA), rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "I2": 0b00000000000000000000011111111111}, 
    "0x34" : {"I1": 0b00000011111000000000000000000000, # l.sd I(rA), rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "I2": 0b00000000000000000000011111111111}, 
    "0x35" : {"I1": 0b00000011111000000000000000000000, # l.sw I(rA), rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "I2": 0b00000000000000000000011111111111}, 
    "0x36" : {"I1": 0b00000011111000000000000000000000, # l.sb I(rA), rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "I2": 0b00000000000000000000011111111111}, 
    "0x37" : {"I1": 0b00000011111000000000000000000000, # l.sh I(rA), rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "I2": 0b00000000000000000000011111111111},
    "0x38" : {"rD": 0b00000011111000000000000000000000, # l.add rD, rA, rB
              "rA": 0b00000000000111110000000000000000,
              "rB": 0b00000000000000001111100000000000,
              "op": 0b00000000000000000000001100000000,
              "op1": 0b00000000000000000000000000001111,
              "op2": 0b00000000000000000000000011000000},
    "0x39" : {"rA": 0b00000000000111110000000000000000, # l.sfeq rA, rB
              "rB": 0b00000000000000001111100000000000,
              "op": 0b00000011111000000000000000000000},
    "0x3c" : {},                                        # l.cust5
    "0x3d" : {},                                        # l.cust6
    "0x3e" : {},                                        # l.cust7
    "0x3f" : {}                                         # l.cust8
}
