Add POSIX a9/xld/xc9 recreation sources and goldens.

Keep WINTEK/ read-only. Add assembler, linker, compiler driver, hex, runtime asm, reloc S-record docs, tests/golden, Makefile, and a pointer to the Mimic 21-Implementation plan. Ignore host bin/ and object files.
This commit is contained in:
2026-10-18 13:41:26 -05:00
parent 9f8893102d
commit adeafa5742
29 changed files with 3000 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
/* opcode6809.h - 6809 instruction table and helpers for assembler */
#ifndef OPCODE6809_H
#define OPCODE6809_H
#include <stdint.h>
typedef enum {
AM_INH = 0, /* inherent */
AM_IMM, /* immediate # */
AM_DIR, /* direct < */
AM_EXT, /* extended > */
AM_REL, /* short branch relative */
AM_LREL, /* long branch relative (16-bit) */
AM_IX0, /* indexed ,R */
AM_IX1, /* indexed n,R (5/8 bit) */
AM_IX2, /* indexed nn,R (16 bit) */
AM_IXAUTO, /* auto inc/dec */
AM_IXIND, /* indirect [,R] variants */
AM_RLIST, /* push/pull reg list */
AM_TFR, /* tfr/exg reg,reg */
AM_MEM, /* other */
AM_INV
} amode_t;
typedef struct {
const char *mnem;
uint8_t opcode;
amode_t mode;
int cycles; /* approx base */
int bytes; /* base size (may vary for indexed) */
} op_t;
const op_t *find_opcode(const char *mnem);
int is_valid_mnem(const char *mnem);
/* For a given mnemonic + addressing, return the post-byte or opcode adjustment.
Returns <0 on failure. For indexed modes the caller still needs to encode postbyte. */
int encode_instr(const char *mnem, amode_t am, uint8_t *out_op, uint8_t *out_post, int *out_len);
#endif