Debian Codegraph @

contrib/toacme/src/vis.c

raw symbols SCIP
1 // ToACME - converts other source codes to ACME format.
2 // Copyright (C) 1999-2015 Marco Baye
3 // Have a look at "main.c" for further info
4 //
5 // VisAss stuff
6
7 #include "ab.h"
8 #include "acme.h"
9 #include "io.h"
10
11
12 static int number_parser(void)
13 {
14 return 0;
15 }
16
17
18 // config struct for shared VisAss/AB code
19 struct vab visass_conf = {
20 VABFLAG_HASLENGTHBYTE,
21 number_parser,
22 visass_ab3_pseudo_opcode_table,
23 visass_ab3_mnemonic_table,
24 2, // we fake absolute addressing because VisAss does not encode the addr mode
25 // meaning of input bytes (0x80-0xec differ between VisAss, AB3 and F8AB)
26 0, // first mnemonic
27 0x48, // count
28 0x48, // first pseudo opcode
29 14, // count
30 0x100, // first unused value (dummy)
31 1 // count (dummy)
32 };
33
34
35 // main
36 void visass_main(void)
37 {
38 IO_set_input_padding(AB_ENDOFLINE);
39 visass_ab3_illegals();
40 IO_process_load_address();
41 // first byte after load address should be AB_ENDOFLINE in VisAss sources
42 if (IO_get_byte() == AB_ENDOFLINE) {
43 IO_get_byte(); // skip it and pre-read first valid byte
44 fputs("Input has VisAss header.\n", stderr);
45 } else {
46 fputs("Input does not have any known VisAss header.\n", stderr);
47 }
48 AB_main(&visass_conf);
49 }