-/* asmain.c */
+/* asmain.c
+
+ Copyright (C) 1989-1995 Alan R. Baldwin
+ 721 Berkeley St., Kent, Ohio 44240
+
+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 3, 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, see <http://www.gnu.org/licenses/>. */
/*
- * (C) Copyright 1989-1995
- * All Rights Reserved
- *
- * Alan R. Baldwin
- * 721 Berkeley St.
- * Kent, Ohio 44240
- *
* 29-Oct-97 JLH pass ";!" comments to output file
*/
char relFile[128];
int
-main(argc, argv)
-char *argv[];
+main(int argc, char *argv[])
{
register char *p;
register int c, i;
case 'c':
case 'C':
- ++cflag;
- break;
+ ++cflag;
+ break;
case 'g':
case 'G':
if (lflag)
lfp = afile(p, "lst", 1);
if (oflag) {
- ofp = afile(p, "rel", 1);
- // save the file name if we have to delete it on error
- strcpy(relFile,afn);
+ ofp = afile(p, "rel", 1);
+ // save the file name if we have to delete it on error
+ strcpy(relFile,afn);
}
if (sflag)
tfp = afile(p, "sym", 1);
radix = 10;
srcline[0] = 0;
page = 0;
+ org_cnt = 0;
stb[0] = 0;
lop = NLPP;
cfile = 0;
*/
VOID
-asexit(i)
-int i;
+asexit(int i)
{
int j;
*/
VOID
-asmbl()
+asmbl(void)
{
register struct mne *mp;
register struct sym *sp;
case S_ORG:
if (dot.s_area->a_flag & A_ABS) {
char buf[NCPS];
+
laddr = absexpr();
- sprintf(buf, "%s%x", abs_ap->a_id, laddr);
+ sprintf(buf, "%s%x", abs_ap->a_id, org_cnt++);
if ((ap = alookup(buf)) == NULL) {
ap = (struct area *) new (sizeof(struct area));
*ap = *areap;
*/
FILE *
-afile(fn, ft, wf)
-char *fn;
-char *ft;
-int wf;
+afile(char *fn, char *ft, int wf)
{
register char *p2, *p3;
register int c;
*/
VOID
-newdot(nap)
-register struct area *nap;
+newdot(register struct area *nap)
{
register struct area *oap;
*/
VOID
-phase(ap, a)
-struct area *ap;
-Addr_T a;
+phase(struct area *ap, Addr_T a)
{
if (ap != dot.s_area || a != dot.s_addr)
err('p');
*/
VOID
-usage()
+usage(void)
{
register char **dp;