forked from StarWolf3000/vasm-mirror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
output_cdef.c
30 lines (24 loc) · 691 Bytes
/
output_cdef.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* cdef.c #define output driver for vasm */
/* (c) in 2020 by Volker Barthelmann */
#include "vasm.h"
static char *copyright="vasm cdef output module 0.1a (c) 2020 Volker Barthelmann";
static void write_output(FILE *f,section *sec,symbol *sym)
{
for(;sym;sym=sym->next){
if(!(sym->flags&VASMINTERN)&&sym->type==EXPRESSION&&sym->expr->type==NUM)
fprintf(f,"#define %s\t0x%llx\n",sym->name,(unsigned long long)sym->expr->c.val);
}
}
static int output_args(char *p)
{
/* no args */
return 0;
}
int init_output_cdef(char **cp,void (**wo)(FILE *,section *,symbol *),int (**oa)(char *))
{
*cp=copyright;
*wo=write_output;
*oa=output_args;
asciiout=1;
return 1;
}