comparison lwasm/insn_inh.c @ 333:507f442dc71e

Add support for 6800 compatibility instructions. The occasional program uses the 6800 compatibility instructions since they are actually specified by Motorola in at least some documentation. They advertised the 6809 as source compatible with the 6800. This mode is not enabled by default, however. It is my belief that receiving an error when using a non-6809 instruction is more useful since it is unlikely that much 6800 source code is being assembled for the 6809 these days. Nevertheless, the --6809compat option is present for just those purposes so one does not have to resort to using macros (which would work equally well in most cases).
author William Astle <lost@l-w.ca>
date Tue, 15 Apr 2014 10:57:34 -0600
parents 2c24602be78f
children 35d4213e6657
comparison
equal deleted inserted replaced
332:26bfe8d557e2 333:507f442dc71e
30 30
31 EMITFUNC(insn_emit_inh) 31 EMITFUNC(insn_emit_inh)
32 { 32 {
33 lwasm_emitop(l, instab[l -> insn].ops[0]); 33 lwasm_emitop(l, instab[l -> insn].ops[0]);
34 } 34 }
35
36 PARSEFUNC(insn_parse_inh6800)
37 {
38 // there may be two operations here so check for both
39 l -> len = OPLEN(instab[l -> insn].ops[0]);
40 if (instab[l -> insn].ops[1] >= 0)
41 l -> len += OPLEN(instab[l -> insn].ops[1]);
42 }
43
44 EMITFUNC(insn_emit_inh6800)
45 {
46 // there may be two operations here so check for both
47 lwasm_emitop(l, instab[l -> insn].ops[0]);
48 if (instab[l -> insn].ops[1] >= 0)
49 lwasm_emitop(l, instab[l -> insn].ops[1]);
50 }