++ed by:
AZAWAWI CXW
Author image Bogdan Drozdowski

NAME

Asm::X86 - List of instructions and registers of x86-compatible processors, validating and converting instructions and memory references.

VERSION

Version 0.60

DESCRIPTION

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 subroutines include converting between AT&T and Intel syntaxes.

SYNOPSIS

    use Asm::X86 qw(@instr is_instr);

    print "YES" if is_instr ("MOV");

EXPORT

 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_addressable32_intel
        is_r32_in64_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_addressable32_att
        is_r32_in64_att

        is_reg
        is_reg8
        is_reg16
        is_reg32
        is_reg64
        is_reg_mm
        is_segreg
        is_reg_fpu
        is_reg_opmask
        is_addressable32
        is_r32_in64

        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_att_instr_to_intel
        conv_intel_addr_to_att
        conv_intel_instr_to_att

        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.
 All subroutines work best given input after any pre-processing, i.e. after
  all macros, constants, etc. have been replaced by the real values.

 The following arrays are exported on request:
        @regs8_intel
        @regs16_intel
        @segregs_intel
        @regs32_intel
        @regs64_intel
        @regs_mm_intel
        @regs_fpu_intel
        @regs_opmask_intel
        @regs_intel

        @regs8_att
        @regs16_att
        @segregs_att
        @regs32_att
        @regs64_att
        @regs_mm_att
        @regs_fpu_att
        @regs_opmask_att
        @regs_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.

DATA

@regs8_intel

 A list of 8-bit registers (as strings) in Intel syntax.

@regs8_att

 A list of 8-bit registers (as strings) in AT&T syntax.

@segregs_intel

 A list of segment registers (as strings) in Intel syntax.

@segregs_att

 A list of segment registers (as strings) in AT&T syntax.

@regs16_intel

 A list of 16-bit registers (as strings), including the segment registers,  in Intel syntax.

@regs16_att

 A list of 16-bit registers (as strings), including the segment registers, in AT&T syntax.

@regs32_intel

 A list of 32-bit registers (as strings) in Intel syntax.

@regs32_att

 A list of 32-bit registers (as strings) in AT&T syntax.

@regs_fpu_intel

 A list of FPU registers (as strings) in Intel syntax.

@regs_fpu_att

 A list of FPU registers (as strings) in AT&T syntax.

@regs64_intel

 A list of 64-bit registers (as strings) in Intel syntax.

@regs64_att

 A list of 64-bit registers (as strings) in AT&T syntax.

@regs_mm_intel

 A list of multimedia (MMX/3DNow!/SSEn) registers (as strings) in Intel syntax.

@regs_mm_att

 A list of multimedia (MMX/3DNow!/SSEn) registers (as strings) in AT&T syntax.

@regs_opmask_intel

 A list of opmask registers (as strings) in Intel syntax.

@regs_opmask_att

 A list of opmask registers (as strings) in AT&T syntax.

@regs_intel

 A list of all x86 registers (as strings) in Intel syntax.

@regs_att

 A list of all x86 registers (as strings) in AT&T syntax.

@instr_intel

 A list of all x86 instructions (as strings) in Intel syntax.

@instr_att

 A list of all x86 instructions (as strings) in AT&T syntax.

@instr

 A list of all x86 instructions (as strings) in Intel and AT&T syntax.

FUNCTIONS

is_reg_intel

 Checks if the given string parameter is a valid x86 register (any size) in Intel syntax.
 Returns 1 if yes.

is_reg_att

 Checks if the given string parameter is a valid x86 register (any size) in AT&T syntax.
 Returns 1 if yes.

is_reg

 Checks if the given string parameter is a valid x86 register (any size).
 Returns 1 if yes.

is_reg8_intel

 Checks if the given string parameter is a valid x86 8-bit register in Intel syntax.
 Returns 1 if yes.

is_reg8_att

 Checks if the given string parameter is a valid x86 8-bit register in AT&T syntax.
 Returns 1 if yes.

is_reg8

 Checks if the given string parameter is a valid x86 8-bit register.
 Returns 1 if yes.

is_reg16_intel

 Checks if the given string parameter is a valid x86 16-bit register in Intel syntax.
 Returns 1 if yes.

is_reg16_att

 Checks if the given string parameter is a valid x86 16-bit register in AT&T syntax.
 Returns 1 if yes.

is_reg16

 Checks if the given string parameter is a valid x86 16-bit register.
 Returns 1 if yes.

is_segreg_intel

 Checks if the given string parameter is a valid x86 segment register in Intel syntax.
 Returns 1 if yes.

is_segreg_att

 Checks if the given string parameter is a valid x86 segment register in AT&T syntax.
 Returns 1 if yes.

is_segreg

 Checks if the given string parameter is a valid x86 segment register.
 Returns 1 if yes.

is_reg32_intel

 Checks if the given string parameter is a valid x86 32-bit register in Intel syntax.
 Returns 1 if yes.

is_reg32_att

 Checks if the given string parameter is a valid x86 32-bit register in AT&T syntax.
 Returns 1 if yes.

is_reg32

 Checks if the given string parameter is a valid x86 32-bit register.
 Returns 1 if yes.

is_addressable32_intel

 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.

is_addressable32_att

 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.

is_addressable32

 Checks if the given string parameter is a valid x86 32-bit register which can be used
        for addressing.
 Returns 1 if yes.

is_r32_in64_intel

 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.

is_r32_in64_att

 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.

is_r32_in64

 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.

is_reg64_intel

 Checks if the given string parameter is a valid x86 64-bit register in Intel syntax.
 Returns 1 if yes.

is_reg64_att

 Checks if the given string parameter is a valid x86 64-bit register in AT&T syntax.
 Returns 1 if yes.

is_reg64

 Checks if the given string parameter is a valid x86 64-bit register.
 Returns 1 if yes.

is_reg_mm_intel

 Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn)
        register in Intel syntax.
 Returns 1 if yes.

is_reg_mm_att

 Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn)
        register in AT&T syntax.
 Returns 1 if yes.

is_reg_mm

 Checks if the given string parameter is a valid x86 multimedia (MMX/3DNow!/SSEn) register.
 Returns 1 if yes.

is_reg_fpu_intel

 Checks if the given string parameter is a valid x86 FPU register in Intel syntax.
 Returns 1 if yes.

is_reg_fpu_att

 Checks if the given string parameter is a valid x86 FPU register in AT&T syntax.
 Returns 1 if yes.

is_reg_fpu

 Checks if the given string parameter is a valid x86 FPU register.
 Returns 1 if yes.

is_reg_opmask_intel

 Checks if the given string parameter is a valid x86 opmask register in Intel syntax.
 Returns 1 if yes.

is_reg_opmask_att

 Checks if the given string parameter is a valid x86 opmask register in AT&T syntax.
 Returns 1 if yes.

is_reg_opmask

 Checks if the given string parameter is a valid x86 opmask register.
 Returns 1 if yes.

is_instr_intel

 Checks if the given string parameter is a valid x86 instruction in Intel syntax.
 Returns 1 if yes.

is_instr_att

 Checks if the given string parameter is a valid x86 instruction in AT&T syntax.
 Returns 1 if yes.

is_instr

 Checks if the given string parameter is a valid x86 instruction in any syntax.
 Returns 1 if yes.

is_valid_16bit_addr_intel

 Checks if the given string parameter (must contain the square braces)
  is a valid x86 16-bit addressing mode in Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_16bit_addr_att

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 16-bit addressing mode in AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_16bit_addr

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 16-bit addressing mode in AT&T or Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_32bit_addr_intel

 Checks if the given string parameter (must contain the square braces)
  is a valid x86 32-bit addressing mode in Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_32bit_addr_att

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 32-bit addressing mode in AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_32bit_addr

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 32-bit addressing mode in AT&T or Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_64bit_addr_intel

 Checks if the given string parameter (must contain the square braces)
  is a valid x86 64-bit addressing mode in Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_64bit_addr_att

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 64-bit addressing mode in AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_64bit_addr

 Checks if the given string parameter (must contain the parentheses)
  is a valid x86 64-bit addressing mode in AT&T or Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_addr_intel

 Checks if the given string parameter (must contain the square braces)
  is a valid x86 addressing mode in Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_addr_att

 Checks if the given string parameter (must contain the braces)
  is a valid x86 addressing mode in AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_valid_addr

 Checks if the given string parameter (must contain the square braces)
  is a valid x86 addressing mode (Intel or AT&T syntax).
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns 1 if yes.

is_att_suffixed_instr

 Tells if the given instruction is suffixed in AT&T syntax.
 Returns 1 if yes.

is_att_suffixed_instr_fpu

 Tells if the given FPU non-integer instruction is suffixed in AT&T syntax.
 Returns 1 if yes

add_att_suffix_instr

 Creates the AT&T syntax instruction array from the Intel-syntax array.
 Returns the new array.

conv_att_addr_to_intel

 Converts the given string representing a valid AT&T addressing mode to Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns the resulting string.

conv_intel_addr_to_att

 Converts the given string representing a valid Intel addressing mode to AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns the resulting string.

conv_att_instr_to_intel

 Converts the given string representing a valid AT&T instruction to Intel syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns the resulting string.

conv_intel_instr_to_att

 Converts the given string representing a valid Intel instruction to AT&T syntax.
 Works best after any pre-processing of the input, i.e. after all macros,
  constants, etc. have been replaced by the real values.
 Returns the resulting string.

SUPPORT AND DOCUMENTATION

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
        https://metacpan.org/release/Asm-X86
        http://search.cpan.org/dist/Asm-X86

    CPAN Request Tracker:
        https://rt.cpan.org/Public/Dist/Display.html?Name=Asm-X86
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=Asm-X86

    CPAN Ratings:
        https://cpanratings.perl.org/dist/Asm-X86
        http://cpanratings.perl.org/d/Asm-X86

AUTHOR

Bogdan Drozdowski, <bogdro at cpan.org>

COPYRIGHT

Copyright 2008-2021 Bogdan Drozdowski, all rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.