File: dcl.h

package info (click to toggle)
crasm 1.8-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 376 kB
  • sloc: ansic: 3,505; makefile: 65
file content (165 lines) | stat: -rwxr-xr-x 5,118 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*  Copyright (C) 1987- Leon Bottou
 * 
 *  This is free documentation; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License as
 *  published by the Free Software Foundation; either version 2 of
 *  the License, or (at your option) any later version.
 * 
 *  The GNU General Public License's references to "object code"
 *  and "executables" are to be interpreted as the output of any
 *  document formatting or typesetting system, including
 *  intermediate and printed output.
 * 
 *  This manual is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public
 *  License along with this manual. Otherwise check the web site
 *  of the Free Software Foundation at http://www.fsf.org.
 */
/*
	CRASM: dcl.h
	definition generales
	LYB 9/87
*/

#ifndef DCL_H
#define DCL_H

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdarg.h>
#include <ctype.h>
#include <setjmp.h>


#ifndef TRUE
# define TRUE	1
#endif
#ifndef FALSE
# define FALSE	0
#endif

typedef signed char byte;

/***************************************************************************/

int asmflags;
int passnumber;
int macrolevel;
int advance;

FILE *file,*scode;
char *filename,*scodename;

char curline[256];
int  linenumber;
char lineprefix;

/* asmflags */
#define F_CPU_GV		(1<<0)
#define F_ORG_GV		(1<<1)
#define F_CODE_ON		(1<<2)
#define F_LIST_ON		(1<<3)
#define F_IFLIST_ON		(1<<4)
#define F_MACROLIST_ON		(1<<6)
#define F_INCLUDELIST_ON	(1<<7)
#define F_LOHI			(1<<8)
#define F_ADDR16		(1<<9)
#define F_ADDR24		(1<<10)
#define F_RELATIF		(1<<11)
#define F_CODE_HEX		(1<<12)
#define F_CODE_SCODE		(1<<13)

#define F_NOLIST		(1<<16)
#define F_NOWARNING		(1<<17)
#define F_NOERROR		(1<<18)
#define F_NOCODE		(1<<19)

/* plus CPU defined FLAGS */

int plen,ppos,llen,lpos;


/***************************************************************************/

/* external: crasm.c */
extern void jmp_buf_copy(jmp_buf in, jmp_buf out);
extern void crasm(int flag);
extern void pass(int pass);
extern int  asmline(char *s, int status);
extern void error(char *s);
extern void warning(char *s);
extern void fatal(char *s);
extern void syntax(char *s);
extern void fileerror(char *s);
extern void setflag(int f);
extern void clrflag(int f);

/* external: filter.c */
extern void zerobuffer(void);
extern int  filter(char *s, char *fil, ...);
extern void reverse(char *s);

/* external: scode.c */
extern void flushscoderaw(void);
extern void closescodefile(void);
extern void setpc(long unsigned int addr);
extern void insert8(unsigned char x);
extern void insert16(short unsigned int x);
extern void insert32(unsigned int x);

/* external: output.c */
extern void settitle(char *s);
extern void setpage(int xplen, int xllen);
extern void outputraw(char *s);
extern void outputEOP(void);
extern void output(char *s);
extern void outputcar(char c);
extern void position(int n);
extern void outputEOL(void);
extern void outputline(void);
extern void outputbyte(int b);
extern void outputaddr(unsigned long a);
extern char hexa[];


/* external: macros.c */
extern void linegets(char *buffer, int length);
extern int  Xmacro(int status, char *label, char *mnemo, char *oper);
extern int  Xexitm(int status, char *label, char *mnemo, char *oper);
extern int  Xendm(int status, char *label, char *mnemo, char *oper);
extern int  Xif(int status, char *label, char *mnemo, char *oper);
extern int  Xelse(int status, char *label, char *mnemo, char *oper);
extern int  Xendc(int status, char *label, char *mnemo, char *oper);

/* external: pseudos.c */
extern int  Xequ(int modifier, char *label, char *mnemo, char *oper);
extern int  Xinclude(int modifier, char *label, char *mnemo, char *oper);
extern int  Xdc(int modifier, char *label, char *mnemo, char *oper);
extern int  Xds(int modifier, char *label, char *mnemo, char *oper);
extern int  Xalign(int modifier, char *label, char *mnemo, char *oper);
extern int  Xoutput(int modifier, char *label, char *mnemo, char *oper);
extern int  Xcpu(int modifier, char *label, char *mnemo, char *oper);
extern int  Xnam(int modifier, char *label, char *mnemo, char *oper);
extern int  Xasc(int modifier, char *label, char *mnemo, char *oper);
extern int  Xcode(int modifier, char *label, char *mnemo, char *oper);
extern int  Xdummy(int modifier, char *label, char *mnemo, char *oper);
extern int  Xskip(int modifier, char *label, char *mnemo, char *oper);
extern int  Xpage(int modifier, char *label, char *mnemo, char *oper);
extern int  Xlist(int modifier, char *label, char *mnemo, char *oper);
extern int  Xmlist(int modifier, char *label, char *mnemo, char *oper);
extern int  Xclist(int modifier, char *label, char *mnemo, char *oper);
extern int  Xilist(int modifier, char *label, char *mnemo, char *oper);
extern int  Xfail(int modifier, char *label, char *mnemo, char *oper);






#endif