     //Temp Variables
     var lc_opcode = ""
     
-    //Check if arg2 is blank 
+    //Check if arg2 is blank
     if (arg2 == ""){
         arg2 = arg1
         arg1 = "A"
     }
     
-   
+    
     if (len(s: arg1) == 1){
         if (len(s: arg2) == 1 || matches(s: arg2, pattern: "$REGISTER[HL]$")){
             lc_opcode = lc(s: opcode)


import Foundation

//Script Based of z80.pl from the SMS Miracle Emulator 
//Additional elements ported from https://github.com/remogatto/z80/



    if opcode == "RES" {
        mask = 0xff - mask
    }
    
    //Format Output
    print(NSString(format : "0x%02x", mask), separator: "", terminator: "", to: &hexOutput)
    
    //Return hex code
