Lhogho
0.0.028
|
Go to the source code of this file.
Macros | |
#define | SPACES TEXT(" ") |
#define | DISASM_LABEL 1 |
position for labels More... | |
#define | DISASM_INSTR 14 |
position for instructions More... | |
#define | DISASM_PARAM 20 |
position for parameters More... | |
#define | DISASM_REM 40 |
position for remarks More... | |
#define | BUF_SIZE 128 |
Functions | |
void | emit_1 (context_t *ctx, byte_t data) |
emits a byte More... | |
void | emit_2 (context_t *ctx, ushort_t data) |
emits two bytes More... | |
void | emit_4 (context_t *ctx, uint_t data) |
emits four bytes More... | |
void | reemit_4 (context_t *ctx, uint_t offset, uint_t data) |
reemits four bytes at specific offset More... | |
void | disasm_set_pos (int pos) |
set disassembler's position More... | |
void | disasm (context_t *ctx, int mode, chars_t format,...) |
disassembler's print function More... | |
Variables | |
int | disasm_pos = 1 |
#define BUF_SIZE 128 |
ctx | compilation context |
data | byte to emit |
Emits (simulated or real) a byte to generated code. If ctx->generate=1 then the byte is really generated, otherwise only ctx->size is incremented in order to estimate the compiled size (in bytes).
ctx | compilation context |
data | bytes to emit |
Emits (simulated or real) 2 bytes to generated code. If ctx->generate=1 then the bytes are really generated, otherwise only ctx->size is incremented in order to estimate the compiled size (in bytes).
ctx | compilation context |
data | bytes to emit |
Emits (simulated or real) 4 bytes to generated code. If ctx->generate=1 then the bytes are really generated, otherwise only ctx->size is incremented in order to estimate the compiled size (in bytes).
ctx | compilation context |
offset | offset where to reemit the data |
data | bytes to reemit |
Reemits (simulated or real) 4 bytes to specific location. If ctx->generate=1 then the bytes are really generated.
void disasm_set_pos | ( | int | pos) |
ctx | compilation context |
mode | disassembly mode |
format | format string |
Prints text generated by the disassembler. The mode
parameter determines the initial position and the color of the test:
mode==0 - continues the last mode mode==1 - prints assembler instruction (white, bold) mode==2 - prints information text (green) mode==3 - prints remark (gray) mode==4 - prints label (white, bold)
The format
parameter is like a printf format string, but supports only these format specifiers:
d - integer number (like 5 or -5) p - integer number with forced sign (like +5 or -5) s - string of type chars_t a - atom of type atom_t l - atom of type atom_t, but only the first node of a list/expression is printed
Definition at line 195 of file asm.c.