Asm::X86 - List of instructions and registers of Intel x86-compatible processors, validating and converting instructions and memory references.
Version 0.21
This module provides the user with the ability to check whether a given string represents an x86 processor register or instruction. It also provides lists of registers and instructions and allows to check if a given expression is a valid addressing mode. Other subrotuines include converting between AT&T and Intel syntaxes.
use Asm::X86 qw(@instr is_instr); print "YES" if is_instr ("MOV");
Nothing is exported by default. The following functions are exported on request: is_reg_intel is_reg8_intel is_reg16_intel is_reg32_intel is_reg64_intel is_reg_mm_intel is_segreg_intel is_reg_fpu_intel is_reg_opmask_intel is_reg_att is_reg8_att is_reg16_att is_reg32_att is_reg64_att is_reg_mm_att is_segreg_att is_reg_fpu_att is_reg_opmask_att is_reg is_reg8 is_reg16 is_reg32 is_reg64 is_reg_mm is_segreg is_reg_fpu is_reg_opmask is_instr_intel is_instr_att is_instr is_valid_16bit_addr_intel is_valid_32bit_addr_intel is_valid_64bit_addr_intel is_valid_addr_intel is_valid_16bit_addr_att is_valid_32bit_addr_att is_valid_64bit_addr_att is_valid_addr_att is_valid_16bit_addr is_valid_32bit_addr is_valid_64bit_addr is_valid_addr conv_att_addr_to_intel conv_intel_addr_to_att conv_att_instr_to_intel conv_intel_instr_to_att is_addressable32_intel is_addressable32_att is_addressable32 is_r32_in64_intel is_r32_in64_att is_r32_in64 is_att_suffixed_instr is_att_suffixed_instr_fpu add_att_suffix_instr These check if the given string parameter belongs to the specified class of registers or instructions or is a vaild addressing mode. The "convert*" functions can be used to convert the given instruction (including the operands)/addressing mode between AT&T and Intel syntaxes. The "_intel" and "_att" suffixes mean the Intel and AT&T syntaxes, respectively. No suffix means either Intel or AT&T. The following arrays are exported on request: @regs8_intel @regs16_intel @segregs_intel @regs32_intel @regs64_intel @regs_mm_intel @regs_intel @regs_fpu_intel @regs_opmask_intel @regs8_att @regs16_att @segregs_att @regs32_att @regs64_att @regs_mm_att @regs_att @regs_fpu_att @regs_opmask_att @instr_intel @instr_att @instr These contain all register and instruction mnemonic names as lower-case strings. The "_intel" and "_att" suffixes mean the Intel and AT&T syntaxes, respectively. No suffix means either Intel or AT&T.
A list of 8-bit registers (as strings) in Intel syntax.
A list of 8-bit registers (as strings) in AT&T syntax.
A list of segment registers (as strings) in Intel syntax.
A list of segment registers (as strings) in AT&T syntax.
A list of 16-bit registers (as strings), including the segment registers, in Intel syntax.
A list of 16-bit registers (as strings), including the segment registers, in AT&T syntax.
A list of 32-bit registers (as strings) in Intel syntax.
A list of 32-bit registers (as strings) in AT&T syntax.
A list of FPU registers (as strings) in Intel syntax.
A list of FPU registers (as strings) in AT&T syntax.
A list of 64-bit registers (as strings) in Intel syntax.
A list of 64-bit registers (as strings) in AT&T syntax.
A list of multimedia (MMX/3DNow!/SSEn) registers (as strings) in Intel syntax.
A list of multimedia (MMX/3DNow!/SSEn) registers (as strings) in AT&T syntax.
A list of opmask registers (as strings) in Intel syntax.
A list of opmask registers (as strings) in AT&T syntax.
A list of all x86 registers (as strings) in Intel syntax.
A list of all x86 registers (as strings) in AT&T syntax.
A list of all x86 instructions (as strings) in Intel syntax.
A list of all x86 instructions (as strings) in AT&T syntax.
A list of all x86 instructions (as strings) in Intel and AT&T syntax.
Checks if the given string parameter is a valid x86 register (any size) in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 register (any size) in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 register (any size). Returns 1 if yes.
Checks if the given string parameter is a valid x86 8-bit register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 8-bit register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 8-bit register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 16-bit register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 16-bit register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 16-bit register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 segment register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 segment register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 segment register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register which can be used for addressing in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register which can be used for addressing in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register which can be used for addressing. Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register which can only be used in 64-bit mode (that is, checks if the given string parameter is a 32-bit subregister of a 64-bit register). Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register in Intel syntax which can only be used in 64-bit mode (that is, checks if the given string parameter is a 32-bit subregister of a 64-bit register). Returns 1 if yes.
Checks if the given string parameter is a valid x86 32-bit register in AT&T syntax which can only be used in 64-bit mode (that is, checks if the given string parameter is a 32-bit subregister of a 64-bit register). Returns 1 if yes.
Checks if the given string parameter is a valid x86 64-bit register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 64-bit register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 64-bit register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn) register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn) register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn) register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 FPU register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 FPU register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 FPU register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 opmask register in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 opmask register in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 opmask register. Returns 1 if yes.
Checks if the given string parameter is a valid x86 instruction in Intel syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 instruction in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter is a valid x86 instruction in any syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the square braces) is a valid x86 16-bit addressing mode in Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 16-bit addressing mode in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 16-bit addressing mode in AT&T or Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the square braces) is a valid x86 32-bit addressing mode in Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 32-bit addressing mode in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 32-bit addressing mode in AT&T or Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the square braces) is a valid x86 64-bit addressing mode in Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 64-bit addressing mode in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the parentheses) is a valid x86 64-bit addressing mode in AT&T or Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the square braces) is a valid x86 addressing mode in Intel syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the braces) is a valid x86 addressing mode in AT&T syntax. Returns 1 if yes.
Checks if the given string parameter (must contain the square braces) is a valid x86 addressing mode (Intel or AT&T syntax). Returns 1 if yes.
PRIVATE SUBROUTINE. Add a percent character ('%') in front of each element in the array given as a parameter. Returns the new array.
Tells if the given instruction is suffixed in AT&T syntax. Returns 1 if yes
Tells if the given FPU non-integer instruction is suffixed in AT&T syntax. Returns 1 if yes
Creates the AT&T syntax instruction array from the Intel-syntax array. Returns the new array.
PRIVATE SUBROUTINE. Returns an array of the provided arguments with duplicate entries removed.
PRIVATE SUBROUTINE. Removes unnecessary '+' characters from the beginning of the given string. Returns the resulting string (or '+' if it was empty).
Converts the given string representing a valid AT&T addressing mode to Intel syntax. Returns the resulting string.
Converts the given string representing a valid Intel addressing mode to AT&T syntax. Returns the resulting string.
Converts the given string representing a valid AT&T instruction to Intel syntax. Returns the resulting string.
Converts the given string representing a valid Intel instruction to AT&T syntax. Returns the resulting string.
After installing, you can find documentation for this module with the perldoc command.
perldoc Asm::X86
You can also look for information at:
Search CPAN http://search.cpan.org/dist/Asm-X86 CPAN Request Tracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Asm-X86 AnnoCPAN, annotated CPAN documentation: http://annocpan.org/dist/Asm-X86 CPAN Ratings: http://cpanratings.perl.org/d/Asm-X86
Bogdan Drozdowski, <bogdandr at op.pl>
<bogdandr at op.pl>
Copyright 2008-2012 Bogdan Drozdowski, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Asm::X86, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Asm::X86
CPAN shell
perl -MCPAN -e shell install Asm::X86
For more information on module installation, please visit the detailed CPAN module installation guide.