v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
reverse.h
Go to the documentation of this file.
1 
4 /*
5  * Copyright (c) 2013 Daniel Loffgren
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to
9  * deal in the Software without restriction, including without limitation the
10  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11  * sell copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23  * IN THE SOFTWARE.
24  */
25 
26 #ifndef v6502_reverse_h
27 #define v6502_reverse_h
28 
29 #include <stdio.h>
30 
31 #include <v6502/cpu.h>
32 #include <as6502/parser.h>
33 #include <ld6502/object.h>
34 
40 
42 void dis6502_stringForOpcode(char *string, size_t len, v6502_opcode opcode);
43 
45 void dis6502_stringForOperand(char *string, size_t len, v6502_address_mode opcode, uint8_t high, uint8_t low);
46 
48 void dis6502_stringForInstruction(char *string, size_t len, v6502_opcode opcode, uint8_t high, uint8_t low);
49 
52 
55 
57 int dis6502_printAnnotatedInstruction(FILE *out, v6502_cpu *cpu, uint16_t address, as6502_symbol_table *table);
58 
61 #endif
void dis6502_deriveSymbolsForObjectBlob(as6502_symbol_table *table, ld6502_object_blob *blob)
Create symbols in a as6502_symbol_table for all branch instructions in a given ld6502_object_blob tha...
Definition: reverse.c:412
void dis6502_stringForOperand(char *string, size_t len, v6502_address_mode opcode, uint8_t high, uint8_t low)
Get the string representation of the operands in a given address mode.
Definition: reverse.c:353
int dis6502_isBranchOpcode(v6502_opcode opcode)
Return YES if a given v6502_opcode reflects a branching instruction.
Definition: reverse.c:61
void dis6502_stringForInstruction(char *string, size_t len, v6502_opcode opcode, uint8_t high, uint8_t low)
Get the complete string representation of an instruction line.
Definition: reverse.c:403
void dis6502_stringForOpcode(char *string, size_t len, v6502_opcode opcode)
Get the string representation of an opcode.
Definition: reverse.c:80
int dis6502_printAnnotatedInstruction(FILE *out, v6502_cpu *cpu, uint16_t address, as6502_symbol_table *table)
Print, to file pointer, an address and byte annotated disassembled line of assembly at the given addr...
Definition: reverse.c:34
v6502_address_mode
Address Modes.
Definition: cpu.h:279
The assembler&#39;s representation of an object file in memory.
Definition: object.h:47
Assembly language parsing.
Virtual CPU Object.
Definition: cpu.h:35
Virtual CPU.
Binary object management.
The assembler&#39;s per-object symbol table structure, which holds all symbols.
Definition: symbols.h:71
A single blob of typeless object data.
Definition: object.h:36
void dis6502_deriveSymbolsForObject(ld6502_object *obj)
Create symbols for all branch instructions that do not already have corresponding entries for all ld6...
Definition: reverse.c:437
v6502_opcode
Instruction Set.
Definition: cpu.h:58