home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CBM Funet Archive
/
cbm-funet-archive-2003.iso
/
cbm
/
programming
/
msdos
/
xa214f.lzh
/
xa214f
/
src
/
xah.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-12-30
|
6KB
|
200 lines
/*
XA65 - 6502 CROSS ASSEMBLER AND UTILITY SUITE
cOPYRIGHT (c) 1989-1997 aNDR{$e9} fACHAT (A.FACHAT@PHYSIK.TU-CHEMNITZ.DE)
tHIS PROGRAM IS FREE SOFTWARE; 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.
tHIS PROGRAM 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 PROGRAM; IF NOT, WRITE TO THE fREE sOFTWARE
fOUNDATION, iNC., 675 mASS aVE, cAMBRIDGE, ma 02139, usa.
*/
#DEFINE anzlab 5000 /* MAL 14 -> bYTE */
#DEFINE labmem 40000l
#DEFINE maxlab 32
#DEFINE maxblk 16
#DEFINE maxfile 7
#DEFINE maxline 2048
#DEFINE maxpp 40000l
#DEFINE anzdef 2340 /* MAL 14 -> bYTE , anzdef*14<32768 */
#DEFINE tmpmem 200000l /* zWISCHENSPEICHER VON pASS1 NACH pASS 2 */
TYPEDEF STRUCT {$7b}
INT BLK;
INT VAL;
INT LEN;
INT FL; /* 0 = LABEL VALUE NOT VALID/KNOWN, 1 = LABEL VALUE KNOWN */
INT AFL;/* 0 = NO ADDRESS (NO RELOCATION), 1 = ADDRESS LABEL */
INT NEXTINDEX;
CHAR *N;
{$7d} lABTAB;
TYPEDEF STRUCT {$7b}
CHAR *SEARCH;
INT S_LEN;
CHAR *REPLACE;
INT P_ANZ;
INT NEXTINDEX;
{$7d} lIST;
#DEFINE memlen (4+tmpmem+maxpp+labmem+(LONG)(SIZEOF(lABTAB)*anzlab)+(LONG)(SIZEOF(lIST)*anzdef))
#DEFINE dirchar '/'
#DEFINE dircstring "/"
/* FOR aTARI:
#DEFINE dirchar '\\'
#DEFINE dircstring "\\"
*/
#DEFINEbufsize4096/* fILE-pUFFEGROESSE (WG fESTPLATTE)*/
#DEFINE e_ok 0 /* fEHLERNUMMERN */
#DEFINE e_syntax -1 /* sYNTAX fEHLER */
#DEFINE e_labdef -2 /* lABEL DEFINIERT */
#DEFINE e_nodef -3 /* lABEL NICHT DEFINIERT */
#DEFINE e_labfull -4 /* lABELTABELLE VOLL */
#DEFINE e_labexp -5 /* lABEL ERWARTET */
#DEFINE e_nomem -6 /* KEIN sPEICHER MEHR */
#DEFINE e_illcode -7 /* iLLEGALER oPCODE */
#DEFINE e_adress -8 /* iLLEGALE aDRESSIERUNG */
#DEFINE e_range -9 /* bRANCH OUT OF RANGE */
#DEFINE e_overflow -10 /* uEBERLAUF */
#DEFINE e_div -11 /* dIVISION DURCH nULL */
#DEFINE e_psoexp -12 /* pSEUDO-oPCODE ERWARTET */
#DEFINE e_blkovr -13 /* bLOCK-sTACK uEBERGELAUFEN */
#DEFINE e_fnf -14 /* fILE NOT FOUND (PP) */
#DEFINE e_eof -15 /* eND OF fILE */
#DEFINE e_block -16 /* bLOCK INKONSISTENT */
#DEFINE e_noblk -17
#DEFINE e_nokey -18
#DEFINE e_noline -19
#DEFINE e_okdef -20 /* OKDEF */
#DEFINE e_dsb -21
#DEFINE e_newline -22
#DEFINE e_newfile -23
#DEFINE e_cmos -24
#DEFINE e_anzpar -25
#DEFINE e_illpointer -26 /* ILLEGAL POINTER ARITHMETIC! */
#DEFINE e_illsegment -27 /* ILLEGAL POINTER ARITHMETIC! */
#DEFINE e_optlen -28 /* FILE HEADER OPTION TOO LONG */
#DEFINE e_romopt -29 /* HEADER OPTION NOT DIRECTLY AFTER FILE START
IN ROMABLE MODE */
#DEFINE e_illalign -30 /* ILLEGAL ALIGN VALUE */
#DEFINE w_adrreloc-31/* WORD RELOCATION IN BYTE VALUE */
#DEFINE w_bytreloc-32/* BYTE RELOCATION IN WORD VALUE */
#DEFINE e_wpointer -33 /* ILLEGAL POINTER ARITHMETIC! */
#DEFINE w_addracc-34/* ADDR ACCESS TO LOW OR HIGH BYTE POINTER */
#DEFINE w_highacc-35/* HIGH BYTE ACCESS TO LOW BYTE POINTER */
#DEFINE w_lowacc-36/* LOW BYTE ACCESS TO HIGH BYTE POINTER */
#DEFINE t_value -1
#DEFINE t_label -2
#DEFINE t_op -3
#DEFINE t_end -4
#DEFINE t_line -5
#DEFINE t_file -6
#DEFINE t_pointer -7
#DEFINE p_start 0 /* pRIORITAETEN FUER aRITHMETIK */
#DEFINE p_lor 1 /* vON ZWEI oPERATIONEN WIRD IMMER */
#DEFINE p_land 2 /* DIE MIT DER HOEHEREN pRIORITAET */
#DEFINE p_or 3 /* ZUERST AUSGEFUEHRT */
#DEFINE p_xor 4
#DEFINE p_and 5
#DEFINE p_equ 6
#DEFINE p_cmp 7
#DEFINE p_shift 8
#DEFINE p_add 9
#DEFINE p_mult 10
#DEFINE p_inv 11
#DEFINE a_adr 0X8000/* ALL ARE OR'D WITH (AFL = SEGMENT TYPE)<<8 */
#DEFINE a_high 0X4000/* OR'D WITH THE LOW BYTE */
#DEFINE a_low 0X2000
#DEFINE a_mask 0XE000/* RELOC TYPE MASK */
#DEFINE a_fmask 0X0F00/* SEGMENT TYPE MASK */
#DEFINE fm_obj 0X1000
#DEFINE fm_size 0X2000
#DEFINE fm_reloc 0X4000
#DEFINE fm_cpu 0X8000
#DEFINE seg_abs 0
#DEFINE seg_undef 1
#DEFINE seg_text 2
#DEFINE seg_data 3
#DEFINE seg_bss 4
#DEFINE seg_zero 5
#DEFINE seg_max 6
TYPEDEF STRUCT fOPT {$7b}
SIGNED CHAR *TEXT; /* TEXT AFTER PASS1 */
INT LEN;
{$7d} fOPT;
TYPEDEF STRUCT RELOCATEiNFO {$7b}
INT NEXT;
INT ADR;
INT AFL;
INT LAB;
{$7d} RELOCATEiNFO;
TYPEDEF STRUCT {$7b}
INTFMODE;
INT SLEN;
INTRELMODE;
INTOLD_ABSPC;
INTBASE[seg_max];
INTLEN[seg_max];
STRUCT {$7b}
SIGNED CHAR *TMP;
UNSIGNED LONGTMPZ;
UNSIGNED LONGTMPE;
{$7d} MN;
STRUCT {$7b}
INT*ULIST;
INT UN;
INT UM;
{$7d} UD;
STRUCT {$7b}
RELOCATEiNFO *RLIST;
INT MLIST;
INTNLIST;
INTFIRST;
{$7d} RT;
STRUCT {$7b}
RELOCATEiNFO *RLIST;
INT MLIST;
INTNLIST;
INTFIRST;
{$7d} RD;
STRUCT {$7b}
fOPT*OLIST;
INTMLIST;
INTNLIST;
{$7d} FO;
STRUCT {$7b}
INT HASHINDEX[256];
lABTAB*LT;
INTLTI;
INTLTM;
{$7d} LA;
{$7d} fILE;
EXTERN fILE *AFILE;