mirror of
https://github.com/fachat/xa65.git
synced 2025-08-08 19:25:14 +00:00
add "-U" cmd line option
This commit is contained in:
@@ -96,7 +96,10 @@ not affect colon interpretation elsewhere. This option is deprecated. Use
|
|||||||
instead.
|
instead.
|
||||||
.TP
|
.TP
|
||||||
.B \-R
|
.B \-R
|
||||||
Start assembler in relocating mode.
|
Start assembler in relocating mode, i.e. use segments.
|
||||||
|
.TP
|
||||||
|
.B \-U
|
||||||
|
Do not allow undefined labels in relocating mode.
|
||||||
.TP
|
.TP
|
||||||
.B \-Llabel
|
.B \-Llabel
|
||||||
Defines
|
Defines
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
#define ANZWARN 13
|
#define ANZWARN 13
|
||||||
|
|
||||||
#define programname "xa"
|
#define programname "xa"
|
||||||
#define progversion "v2.3.5"
|
#define progversion "v2.3.5+af"
|
||||||
#define authors "Written by Andre Fachat, Jolse Maginnis, David Weinehall and Cameron Kaiser"
|
#define authors "Written by Andre Fachat, Jolse Maginnis, David Weinehall and Cameron Kaiser"
|
||||||
#define copyright "Copyright (C) 1989-2009 Andre Fachat, Jolse Maginnis, David Weinehall\nand Cameron Kaiser."
|
#define copyright "Copyright (C) 1989-2009 Andre Fachat, Jolse Maginnis, David Weinehall\nand Cameron Kaiser."
|
||||||
|
|
||||||
@@ -73,6 +73,7 @@ int romaddr = 0;
|
|||||||
int noglob = 0;
|
int noglob = 0;
|
||||||
int showblk = 0;
|
int showblk = 0;
|
||||||
int crossref = 0;
|
int crossref = 0;
|
||||||
|
int noundef = 0; // overrides -R acceptance of undefined labels
|
||||||
char altppchar;
|
char altppchar;
|
||||||
|
|
||||||
/* local variables */
|
/* local variables */
|
||||||
@@ -270,6 +271,9 @@ int main(int argc,char *argv[])
|
|||||||
case 'R':
|
case 'R':
|
||||||
relmode = 1;
|
relmode = 1;
|
||||||
break;
|
break;
|
||||||
|
case 'U':
|
||||||
|
noundef = 1;
|
||||||
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
s = (signed char*)strstr(argv[i]+2,"=");
|
s = (signed char*)strstr(argv[i]+2,"=");
|
||||||
if(s) *s = ' ';
|
if(s) *s = ' ';
|
||||||
@@ -912,7 +916,8 @@ static void usage(int default816, FILE *fp)
|
|||||||
" -M allow ``:'' to appear in comments for MASM compatibility\n"
|
" -M allow ``:'' to appear in comments for MASM compatibility\n"
|
||||||
" -Xcompatset set compatibility flags for other assemblers, known values are:\n"
|
" -Xcompatset set compatibility flags for other assemblers, known values are:\n"
|
||||||
" MASM, CA65\n"
|
" MASM, CA65\n"
|
||||||
" -R start assembler in relocating mode\n");
|
" -R start assembler in relocating mode\n"
|
||||||
|
" -U do not allow undefined labels in relocating mode\n");
|
||||||
fprintf(fp,
|
fprintf(fp,
|
||||||
" -Llabel defines `label' as absolute, undefined label even when linking\n"
|
" -Llabel defines `label' as absolute, undefined label even when linking\n"
|
||||||
" -p<c> replace preprocessor char '#' with custom, e.g. '-p!' replaces it with '!'\n"
|
" -p<c> replace preprocessor char '#' with custom, e.g. '-p!' replaces it with '!'\n"
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include "xah.h" /* For SEG_MAX */
|
#include "xah.h" /* For SEG_MAX */
|
||||||
|
|
||||||
extern int ncmos, cmosfl, w65816, n65816;
|
extern int ncmos, cmosfl, w65816, n65816;
|
||||||
extern int masm, ca65, nolink;
|
extern int masm, ca65, nolink,noundef;
|
||||||
extern int noglob;
|
extern int noglob;
|
||||||
extern int showblk;
|
extern int showblk;
|
||||||
extern int relmode;
|
extern int relmode;
|
||||||
|
@@ -122,7 +122,7 @@ static int ag_term(signed char *s, int p, int *v, int *nafl, int *label)
|
|||||||
//printf("label: er=%d, seg=%d, afl=%d, nolink=%d, fundef=%d\n",
|
//printf("label: er=%d, seg=%d, afl=%d, nolink=%d, fundef=%d\n",
|
||||||
// er, segment, afl, nolink, fundef);
|
// er, segment, afl, nolink, fundef);
|
||||||
if(er==E_NODEF && segment != SEG_ABS && fundef ) {
|
if(er==E_NODEF && segment != SEG_ABS && fundef ) {
|
||||||
if( nolink || ((afl==SEG_UNDEF) || (afl==SEG_UNDEFZP))) {
|
if( (nolink && !noundef) || ((afl==SEG_UNDEF) || (afl==SEG_UNDEFZP))) {
|
||||||
er = E_OK;
|
er = E_OK;
|
||||||
*v = 0;
|
*v = 0;
|
||||||
if(afl!=SEG_UNDEFZP) {
|
if(afl!=SEG_UNDEFZP) {
|
||||||
|
@@ -2161,7 +2161,7 @@ fprintf(stderr, "could not find %s\n", (char *)s+p);
|
|||||||
/*
|
/*
|
||||||
if(afl==SEG_ZEROUNDEF) uz++;
|
if(afl==SEG_ZEROUNDEF) uz++;
|
||||||
*/
|
*/
|
||||||
ud++;
|
ud++; // number of undefined labels
|
||||||
er=E_OK;
|
er=E_OK;
|
||||||
}
|
}
|
||||||
p+=ll;
|
p+=ll;
|
||||||
|
Reference in New Issue
Block a user