package asm type Mnemonic uint8 const ( NONE Mnemonic = iota // Arithmetic ADD DIV MODULO MUL NEGATE SUB // Bitwise operations AND OR SHIFTL SHIFTRS XOR // Data movement MOVE LOAD POP PUSH STORE // Control flow CALL JE JNE JG JGE JL JLE JUMP LABEL RETURN SYSCALL // Others COMMENT COMPARE ) // String returns a human readable version. func (m Mnemonic) String() string { switch m { case ADD: return "add" case AND: return "and" case CALL: return "call" case COMMENT: return "comment" case COMPARE: return "compare" case DIV: return "div" case JUMP: return "jump" case JE: return "jump if ==" case JNE: return "jump if !=" case JL: return "jump if <" case JG: return "jump if >" case JLE: return "jump if <=" case JGE: return "jump if >=" case LABEL: return "label" case LOAD: return "load" case MODULO: return "mod" case MOVE: return "move" case MUL: return "mul" case NEGATE: return "negate" case OR: return "or" case POP: return "pop" case PUSH: return "push" case RETURN: return "return" case SHIFTL: return "shift l" case SHIFTRS: return "shift rs" case SUB: return "sub" case STORE: return "store" case SYSCALL: return "syscall" case XOR: return "xor" default: return "" } }