32 lines
694 B
C
32 lines
694 B
C
#ifndef _ASM_H
|
|
#define _ASM_H
|
|
|
|
#include "x86encode.h"
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef size_t ip;
|
|
extern ip here;
|
|
|
|
/// Jump to a known address.
|
|
void inst_jump(ip there);
|
|
|
|
/// Jump to an unresolved address.
|
|
ip inst_jump_unresolved(void);
|
|
void inst_jump_resolve(ip disp, ip there);
|
|
|
|
void inst_mov_imm(reg reg, uint64_t imm);
|
|
void inst_mov_imm_i64(reg reg, int64_t imm);
|
|
void inst_syscall(void);
|
|
|
|
void inst_push(reg reg);
|
|
void inst_pop(reg reg);
|
|
|
|
void inst_mov(reg dest, reg src);
|
|
void inst_mov_from(reg dest, reg base);
|
|
void inst_mov_from_disp(reg dest, reg base, int32_t disp);
|
|
void inst_mov_to(reg base, reg src);
|
|
void inst_mov_to_disp(reg base, reg src, int32_t disp);
|
|
#endif
|