Botan 1.10.17

Macros
asm_x86_32.h File Reference

Go to the source code of this file.

## Macros
#define | ADD(TO, FROM) addl FROM, TO
#define | ADD2_IMM(TO, FROM, NUM) leal NUM(FROM), TO
#define | ADD3_IMM(TO, FROM, NUM) leal NUM(TO,FROM,1), TO
#define | ADD_IMM(TO, NUM) ADD(TO, IMM(NUM))
#define | ADD_W_CARRY(TO1, TO2, FROM) addl FROM, TO1; adcl IMM(0), TO2;
#define | ALIGN .p2align 4,,15
#define | AND(TO, FROM) andl FROM, TO
#define | ARG(NUM) 4*(PUSHED) + ARRAY4(ESP, NUM)
#define | ARRAY1(REG, NUM) (NUM)(REG)
#define | ARRAY4(REG, NUM) 4*(NUM)(REG)
#define | ARRAY4_INDIRECT(BASE, OFFSET, NUM) 4*(NUM)(BASE,OFFSET,4)
#define | ASSIGN(TO, FROM) movl FROM, TO
#define | ASSIGN_BYTE(TO, FROM) movzbl FROM, TO
#define | BSWAP(REG) bswapl REG
#define | EAX %eax
#define | EBP %ebp
#define | EBX %ebx
#define | ECX %ecx
#define | EDI %edi
#define | EDX %edx
#define | END_FUNCTION(func_name) ret
#define | ESI %esi
#define | ESP %esp
#define | IMM(VAL) $VAL
#define | JUMP_IF_LT(REG, NUM, LABEL)
#define | JUMP_IF_ZERO(REG, LABEL)
#define | LOOP_UNTIL_EQ(REG, NUM, LABEL)
#define | LOOP_UNTIL_LT(REG, NUM, LABEL)
#define | MUL(REG) mull REG
#define | NOT(REG) notl REG
#define | OR(TO, FROM) orl FROM, TO
#define | POP(REG) popl REG
#define | PUSH(REG) pushl REG
#define | RESTORE_REGS()
#define | ROTL_IMM(REG, NUM) roll IMM(NUM), REG
#define | ROTR_IMM(REG, NUM) rorl IMM(NUM), REG
#define | SHL2_3(TO, FROM) leal 0(,FROM,8), TO
#define | SHL_IMM(REG, SHIFT) shll IMM(SHIFT), REG
#define | SHR_IMM(REG, SHIFT) shrl IMM(SHIFT), REG
#define | SPILL_REGS()
#define | START_FUNCTION(func_name)
#define | START_LISTING(FILENAME)
#define | START_LOOP(LABEL)
#define | SUB_IMM(TO, NUM) subl IMM(NUM), TO
#define | XOR(TO, FROM) xorl FROM, TO
#define | ZEROIZE(REG) XOR(REG, REG)

## Macro Definition Documentation

## ◆ ADD

#define ADD | ( |  | TO,
|  |  | FROM
| ) |  | addl FROM, TO

Definition at line 106 of file asm_x86_32.h.

## ◆ ADD2_IMM

#define ADD2_IMM | ( |  | TO,
|  |  | FROM,
|  |  | NUM
| ) |  | leal NUM(FROM), TO

Definition at line 110 of file asm_x86_32.h.

## ◆ ADD3_IMM

#define ADD3_IMM | ( |  | TO,
|  |  | FROM,
|  |  | NUM
| ) |  | leal NUM(TO,FROM,1), TO

Definition at line 111 of file asm_x86_32.h.

## ◆ ADD_IMM

#define ADD_IMM | ( |  | TO,
|  |  | NUM
| ) |  | ADD(TO, IMM(NUM))

Definition at line 107 of file asm_x86_32.h.

## ◆ ADD_W_CARRY

#define ADD_W_CARRY | ( |  | TO1,
|  |  | TO2,
|  |  | FROM
| ) |  | addl FROM, TO1; adcl IMM(0), TO2;

Definition at line 108 of file asm_x86_32.h.

## ◆ ALIGN

#define ALIGN .p2align 4,,15

Definition at line 14 of file asm_x86_32.h.

## ◆ AND

#define AND | ( |  | TO,
|  |  | FROM
| ) |  | andl FROM, TO

Definition at line 119 of file asm_x86_32.h.

## ◆ ARG

#define ARG | ( |  | NUM | ) | 4*(PUSHED) + ARRAY4(ESP, NUM)

Definition at line 81 of file asm_x86_32.h.

## ◆ ARRAY1

#define ARRAY1 | ( |  | REG,
|  |  | NUM
| ) |  | (NUM)(REG)

Definition at line 78 of file asm_x86_32.h.

## ◆ ARRAY4

#define ARRAY4 | ( |  | REG,
|  |  | NUM
| ) |  | 4*(NUM)(REG)

Definition at line 79 of file asm_x86_32.h.

## ◆ ARRAY4_INDIRECT

#define ARRAY4_INDIRECT | ( |  | BASE,
|  |  | OFFSET,
|  |  | NUM
| ) |  | 4*(NUM)(BASE,OFFSET,4)

Definition at line 80 of file asm_x86_32.h.

## ◆ ASSIGN

#define ASSIGN | ( |  | TO,
|  |  | FROM
| ) |  | movl FROM, TO

Definition at line 83 of file asm_x86_32.h.

## ◆ ASSIGN_BYTE

#define ASSIGN_BYTE | ( |  | TO,
|  |  | FROM
| ) |  | movzbl FROM, TO

Definition at line 84 of file asm_x86_32.h.

## ◆ BSWAP

#define BSWAP | ( |  | REG | ) | bswapl REG

Definition at line 126 of file asm_x86_32.h.

## ◆ EAX

#define EAX %eax

Definition at line 66 of file asm_x86_32.h.

## ◆ EBP

#define EBP %ebp

Definition at line 70 of file asm_x86_32.h.

## ◆ EBX

#define EBX %ebx

Definition at line 67 of file asm_x86_32.h.

## ◆ ECX

#define ECX %ecx

Definition at line 68 of file asm_x86_32.h.

## ◆ EDI

#define EDI %edi

Definition at line 71 of file asm_x86_32.h.

## ◆ EDX

#define EDX %edx

Definition at line 69 of file asm_x86_32.h.

## ◆ END_FUNCTION

#define END_FUNCTION | ( |  | func_name | ) | ret

Definition at line 34 of file asm_x86_32.h.

## ◆ ESI

#define ESI %esi

Definition at line 72 of file asm_x86_32.h.

## ◆ ESP

#define ESP %esp

Definition at line 73 of file asm_x86_32.h.

## ◆ IMM

#define IMM | ( |  | VAL | ) | $VAL

Definition at line 104 of file asm_x86_32.h.

## ◆ JUMP_IF_LT

#define JUMP_IF_LT | ( |  | REG,
|  |  | NUM,
|  |  | LABEL
| ) |  |

Value:
cmpl IMM(NUM), REG; \
jl LABEL
IMM
#define IMM(VAL)
Definition: asm_x86_32.h:104

Definition at line 59 of file asm_x86_32.h.

## ◆ JUMP_IF_ZERO

#define JUMP_IF_ZERO | ( |  | REG,
|  |  | LABEL
| ) |  |

Value:
cmpl IMM(0), REG; \
jz LABEL
IMM
#define IMM(VAL)
Definition: asm_x86_32.h:104

Definition at line 55 of file asm_x86_32.h.

## ◆ LOOP_UNTIL_EQ

#define LOOP_UNTIL_EQ | ( |  | REG,
|  |  | NUM,
|  |  | LABEL
| ) |  |

Value:
cmpl IMM(NUM), REG; \
jne LABEL##_LOOP
IMM
#define IMM(VAL)
Definition: asm_x86_32.h:104

Definition at line 44 of file asm_x86_32.h.

## ◆ LOOP_UNTIL_LT

#define LOOP_UNTIL_LT | ( |  | REG,
|  |  | NUM,
|  |  | LABEL
| ) |  |

Value:
cmpl IMM(NUM), REG; \
jge LABEL##_LOOP
IMM
#define IMM(VAL)
Definition: asm_x86_32.h:104

Definition at line 48 of file asm_x86_32.h.

## ◆ MUL

#define MUL | ( |  | REG | ) | mull REG

Definition at line 112 of file asm_x86_32.h.

## ◆ NOT

#define NOT | ( |  | REG | ) | notl REG

Definition at line 121 of file asm_x86_32.h.

## ◆ OR

#define OR | ( |  | TO,
|  |  | FROM
| ) |  | orl FROM, TO

Definition at line 120 of file asm_x86_32.h.

## ◆ POP

#define POP | ( |  | REG | ) | popl REG

Definition at line 87 of file asm_x86_32.h.

## ◆ PUSH

#define PUSH | ( |  | REG | ) | pushl REG

Definition at line 86 of file asm_x86_32.h.

## ◆ RESTORE_REGS

#define RESTORE_REGS | ( |  | ) |

Value:
POP(EBX) ; \
POP(ESI) ; \
POP(EDI) ; \
POP(EBP)
EBP
#define EBP
Definition: asm_x86_32.h:70
ESI
#define ESI
Definition: asm_x86_32.h:72
EBX
#define EBX
Definition: asm_x86_32.h:67
EDI
#define EDI
Definition: asm_x86_32.h:71
POP
#define POP(REG)
Definition: asm_x86_32.h:87

Definition at line 95 of file asm_x86_32.h.

## ◆ ROTL_IMM

#define ROTL_IMM | ( |  | REG,
|  |  | NUM
| ) |  | roll IMM(NUM), REG

Definition at line 124 of file asm_x86_32.h.

## ◆ ROTR_IMM

#define ROTR_IMM | ( |  | REG,
|  |  | NUM
| ) |  | rorl IMM(NUM), REG

Definition at line 125 of file asm_x86_32.h.

## ◆ SHL2_3

#define SHL2_3 | ( |  | TO,
|  |  | FROM
| ) |  | leal 0(,FROM,8), TO

Definition at line 116 of file asm_x86_32.h.

## ◆ SHL_IMM

#define SHL_IMM | ( |  | REG,
|  |  | SHIFT
| ) |  | shll IMM(SHIFT), REG

Definition at line 114 of file asm_x86_32.h.

## ◆ SHR_IMM

#define SHR_IMM | ( |  | REG,
|  |  | SHIFT
| ) |  | shrl IMM(SHIFT), REG

Definition at line 115 of file asm_x86_32.h.

## ◆ SPILL_REGS

#define SPILL_REGS | ( |  | ) |

Value:
PUSH(EBP) ; \
PUSH(EDI) ; \
PUSH(ESI) ; \
PUSH(EBX)
EBP
#define EBP
Definition: asm_x86_32.h:70
ESI
#define ESI
Definition: asm_x86_32.h:72
EBX
#define EBX
Definition: asm_x86_32.h:67
PUSH
#define PUSH(REG)
Definition: asm_x86_32.h:86
EDI
#define EDI
Definition: asm_x86_32.h:71

Definition at line 89 of file asm_x86_32.h.

## ◆ START_FUNCTION

#define START_FUNCTION | ( |  | func_name | ) |

Value:
ALIGN; \
.global func_name; \
.type func_name,@function; \
func_name:
ALIGN
#define ALIGN
Definition: asm_x86_32.h:14

Definition at line 28 of file asm_x86_32.h.

## ◆ START_LISTING

#define START_LISTING | ( |  | FILENAME | ) |

Value:
.file #FILENAME; \
.text; \
ALIGN;

Definition at line 16 of file asm_x86_32.h.

## ◆ START_LOOP

#define START_LOOP | ( |  | LABEL | ) |

Value:
ALIGN; \
LABEL##_LOOP:
ALIGN
#define ALIGN
Definition: asm_x86_32.h:14

Definition at line 40 of file asm_x86_32.h.

## ◆ SUB_IMM

#define SUB_IMM | ( |  | TO,
|  |  | NUM
| ) |  | subl IMM(NUM), TO

Definition at line 109 of file asm_x86_32.h.

## ◆ XOR

#define XOR | ( |  | TO,
|  |  | FROM
| ) |  | xorl FROM, TO

Definition at line 118 of file asm_x86_32.h.

## ◆ ZEROIZE

#define ZEROIZE | ( |  | REG | ) | XOR(REG, REG)

Definition at line 122 of file asm_x86_32.h.