Module: X86InstructionSet

Included in:
X86Assembler
Defined in:
lib/rmasm/x86/x86_instruction_set.rb

Instance Method Summary collapse

Instance Method Details

#aaa(*args) ⇒ Object

Opcode Instruction 64-Bit Mode Compat/Leg Mode Description

37          AAA           Invalid               Valid             ASCII adjust AL after addition


28
29
30
31
32
33
34
35
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 28

def aaa(*args)
  if ( args.length != 0 )
    return Report.error(:R0013, args.length, "0 or 1", :mov)
  else
    instr = X86Instruction.new(:aaa, 0x37)
    instr.fetch
  end
end

#aad(*args) ⇒ Object

Opcode Instruction 64-Bit Mode Compat/Leg Mode Description D5 0A AAD Invalid Valid ASCII adjust AX before division D5 ib (No mnemonic) Invalid Valid Adjust AX before division to



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 41

def aad(*args)
  if !((0..1) === args.length )
    return RMasm::Report.error(:ARGS, args.length, "0 or 1", :mov)
  else
    instr = X86Instruction.new(:aad, 0xD5, *args)
    if (args.length > 0)
      instr.imm = X86Expression.check(args[0], :imm8)
    end
    instr.fetch
  end
end

#call(*args) ⇒ Object



71
72
73
74
75
76
77
78
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 71

def call(*args)
  if args.length != 1
    return RMasm::Report.error(:ARGS, args.length, "1", :call)
  else
    instr = X86Instruction.new(:call, 0xCC, *args)
    instr.fetch
  end
end

#jne(*args) ⇒ Object



89
90
91
92
93
94
95
96
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 89

def jne(*args)
  if args.length != 1
    return RMasm::Report.error(:ARGS, args.length, "1", :call)
  else
    instr = X86Instruction.new(:jne, 0xC0, *args)
    instr.fetch
  end
end

#mov(*args) ⇒ Object



53
54
55
56
57
58
59
60
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 53

def mov(*args)
  if args.length != 2
    return RMasm::Report.error(:ARGS, args.length, "2", :mov)
  else
    instr = X86Instruction.new(:mov, 0xBB, *args)
    instr.fetch
  end
end

#push(*args) ⇒ Object



62
63
64
65
66
67
68
69
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 62

def push(*args)
  if args.length != 1
    return RMasm::Report.error(:ARGS, args.length, "1", :push)
  else
    instr = X86Instruction.new(:push, 0xDD, *args)
    instr.fetch
  end
end

#ret(*args) ⇒ Object



80
81
82
83
84
85
86
87
# File 'lib/rmasm/x86/x86_instruction_set.rb', line 80

def ret(*args)
  if !((0..1) === args.length )
    return RMasm::Report.error(:ARGS, args.length, "0 or 1", :ret)
  else
    instr = X86Instruction.new(:ret, 0xC0, *args)
    instr.fetch
  end
end