1
0
mirror of https://github.com/fachat/xa65.git synced 2024-09-27 17:57:51 +00:00

add "-U" cmd line option

This commit is contained in:
A. Fachat 2012-12-30 15:08:03 +01:00
parent 5e89d57ecf
commit 9e09d4fba2
5 changed files with 14 additions and 6 deletions

View File

@ -96,7 +96,10 @@ not affect colon interpretation elsewhere. This option is deprecated. Use
instead.
.TP
.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
.B \-Llabel
Defines

View File

@ -56,7 +56,7 @@
#define ANZWARN 13
#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 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 showblk = 0;
int crossref = 0;
int noundef = 0; // overrides -R acceptance of undefined labels
char altppchar;
/* local variables */
@ -270,6 +271,9 @@ int main(int argc,char *argv[])
case 'R':
relmode = 1;
break;
case 'U':
noundef = 1;
break;
case 'D':
s = (signed char*)strstr(argv[i]+2,"=");
if(s) *s = ' ';
@ -912,7 +916,8 @@ static void usage(int default816, FILE *fp)
" -M allow ``:'' to appear in comments for MASM compatibility\n"
" -Xcompatset set compatibility flags for other assemblers, known values are:\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,
" -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"

View File

@ -22,7 +22,7 @@
#include "xah.h" /* For SEG_MAX */
extern int ncmos, cmosfl, w65816, n65816;
extern int masm, ca65, nolink;
extern int masm, ca65, nolink,noundef;
extern int noglob;
extern int showblk;
extern int relmode;

View File

@ -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",
// er, segment, afl, nolink, 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;
*v = 0;
if(afl!=SEG_UNDEFZP) {

View File

@ -2161,7 +2161,7 @@ fprintf(stderr, "could not find %s\n", (char *)s+p);
/*
if(afl==SEG_ZEROUNDEF) uz++;
*/
ud++;
ud++; // number of undefined labels
er=E_OK;
}
p+=ll;