Conflicts:
	include/lib/types.h
	src/asm/symbol.c
This commit is contained in:
stag019
2014-11-02 01:00:20 -05:00
45 changed files with 1204 additions and 2148 deletions

View File

@@ -17,8 +17,6 @@
#include "localasm.h"
#include "asmotor.h"
extern SLONG nLineNo;
extern ULONG nTotalLines;
extern ULONG nPC;

View File

@@ -9,6 +9,8 @@
#ifndef ASMOTOR_ASM_FSTACK_H
#define ASMOTOR_ASM_FSTACK_H
#include <stdio.h>
#include "asm/asm.h"
#include "asm/types.h"
#include "asm/lexer.h"
@@ -27,14 +29,17 @@ struct sContext {
ULONG nREPTBlockSize;
};
extern ULONG fstk_RunInclude(char *s);
void
fstk_RunInclude(char *);
extern void fstk_RunMacroArg(SLONG s);
extern ULONG fstk_Init(char *s);
void
fstk_Init(char *);
extern void fstk_Dump(void);
extern void fstk_AddIncludePath(char *s);
extern ULONG fstk_RunMacro(char *s);
extern void fstk_RunRept(ULONG count);
extern void fstk_FindFile(char *s);
FILE *
fstk_FindFile(char *);
extern int yywrap(void);

View File

@@ -5,7 +5,8 @@
#include "asm/types.h"
#define LEXHASHSIZE 512
#define LEXHASHSIZE (1 << 11)
#define MAXSTRLEN 255
struct sLexInitString {
char *tzName;
@@ -18,7 +19,9 @@ struct sLexFloat {
};
struct yy_buffer_state {
char *pBufferStart;
char *pBufferRealStart; // actual starting address
char *pBufferStart; // address where the data is initially written
// after the "safety margin"
char *pBuffer;
ULONG nBufferSize;
ULONG oAtLineStart;

View File

@@ -3,7 +3,7 @@
#include "asm/types.h"
#define HASHSIZE 73
#define HASHSIZE (1 << 16)
#define MAXSYMLEN 256
struct sSymbol {
@@ -35,6 +35,7 @@ struct sSymbol {
#define SYMF_CONST 0x200 /* symbol has a constant value, will
* not be changed during linking */
ULONG calchash(char *s);
void sym_PrepPass1(void);
void sym_PrepPass2(void);
void sym_AddLocalReloc(char *tzSym);

View File

@@ -1,21 +0,0 @@
/* asmotor.h
*
* Contains defines for every program in the ASMotor package
*
* Copyright 1997 Carsten Sorensen
*
*/
#ifndef ASMOTOR_ASMOTOR_H
#define ASMOTOR_ASMOTOR_H
#define ASMOTOR
#define ASMOTOR_VERSION "1.10-linux"
#define ASM_VERSION "1.08c"
#define LINK_VERSION "1.06c"
#define RGBFIX_VERSION "1.02"
#define LIB_VERSION "1.00"
#endif

63
include/extern/err.h vendored Normal file
View File

@@ -0,0 +1,63 @@
/*
* Copyright © 2005-2013 Rich Felker, et al.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef EXTERN_ERR_H
#define EXTERN_ERR_H
#ifdef ERR_IN_LIBC
#include <err.h>
#else
#include <stdarg.h>
#define warn rgbds_warn
#define vwarn rgbds_vwarn
#define warnx rgbds_warnx
#define vwarnx rgbds_vwarnx
#define err rgbds_err
#define verr rgbds_verr
#define errx rgbds_errx
#define verrx rgbds_verrx
#ifdef __cplusplus
extern "C" {
#endif
void warn(const char *, ...);
void vwarn(const char *, va_list);
void warnx(const char *, ...);
void vwarnx(const char *, va_list);
void err(int, const char *, ...);
void verr(int, const char *, va_list);
void errx(int, const char *, ...);
void verrx(int, const char *, va_list);
#ifdef __cplusplus
}
#endif
#endif
#endif

13
include/extern/strl.h vendored Normal file
View File

@@ -0,0 +1,13 @@
#ifndef STRL_H
#define STRL_H
#ifdef STRL_IN_LIBC
#include <string.h>
#else
#define strlcpy rgbds_strlcpy
#define strlcat rgbds_strlcat
size_t strlcpy(char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
#endif
#endif

View File

@@ -1,13 +0,0 @@
#ifndef ASMOTOR_LIB_LIBRARY_H
#define ASMOTOR_LIB_LIBRARY_H
#include "lib/libwrap.h"
extern sLibrary *lib_Read(char *filename);
extern BBOOL lib_Write(sLibrary * lib, char *filename);
extern sLibrary *lib_AddReplace(sLibrary * lib, char *filename);
extern void lib_Free(sLibrary * lib);
extern sLibrary *lib_DeleteModule(sLibrary * lib, char *filename);
extern sLibrary *lib_Find(sLibrary * lib, char *filename);
#endif

View File

@@ -1,19 +0,0 @@
#ifndef ASMOTOR_LIB_LIBWRAP_H
#define ASMOTOR_LIB_LIBWRAP_H
#include "lib/types.h"
#define MAXNAMELENGTH 256
struct LibraryWrapper {
char tName[MAXNAMELENGTH];
UWORD uwTime;
UWORD uwDate;
SLONG nByteLength;
UBYTE *pData;
struct LibraryWrapper *pNext;
};
typedef struct LibraryWrapper sLibrary;
#endif

View File

@@ -1,16 +0,0 @@
#ifndef ASMOTOR_LIB_TYPES_H
#define ASMOTOR_LIB_TYPES_H
#ifndef _MAX_PATH
#define _MAX_PATH 512
#endif
typedef unsigned char UBYTE;
typedef signed char SBYTE;
typedef unsigned short UWORD;
typedef signed short SWORD;
typedef unsigned long ULONG;
typedef signed long SLONG;
typedef signed char BBOOL;
#endif

View File

@@ -2,6 +2,5 @@
#define ASMOTOR_LINK_OBJECT_H
extern void obj_Readfile(char *tzObjectfile);
extern void lib_Readfile(char *tzLibfile);
#endif