From a627dee5e432d76c6efda8d562392a37c72e99a0 Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Mon, 15 Sep 2003 21:46:32 +0000 Subject: [PATCH] added -7 option. added copyright notice. --- dis.h | 26 ++++++++++++++++++++++++++ dis6502.1 | 7 +++++-- initopts.c | 6 +++++- main.c | 25 +++++++++++++++++++++++++ print.c | 25 +++++++++++++++++++++++++ 5 files changed, 86 insertions(+), 3 deletions(-) diff --git a/dis.h b/dis.h index 7931ffb..c2dbb75 100644 --- a/dis.h +++ b/dis.h @@ -1,3 +1,29 @@ +/* + * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith + * + * $Id: dis.h,v 1.5 2003/09/15 21:46:32 eric Exp $ + * Copyright 2000-2003 Eric Smith + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. Note that permission is + * not granted to redistribute this program under the terms of any + * other version of the General Public License. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA + */ + + +extern int sevenbit; /* if true, mask character data with 0x7f + to ignore MSB */ + typedef uint16_t addr_t; #define NPREDEF 10 diff --git a/dis6502.1 b/dis6502.1 index 45e1982..5234264 100644 --- a/dis6502.1 +++ b/dis6502.1 @@ -45,7 +45,10 @@ Read in the predefine file \fIpfile\fP. Up to 20 \fI-p\fP options may be included. .TP .I \-v \fIaddress\fP -Usa an alternate address for the reset and interrupt vectors. +Use an alternate address for the reset and interrupt vectors. +.TP +.I \-7 +Mask off MSB of character data. .PP Lines in pfile consist of: .PP @@ -69,6 +72,6 @@ the trace process to continue at the address given. .I .stop causes the trace process to stop at the address given. -.SH AUTHOR +.SH AUTHORS Robert Bond, Udi Finkelstein, and Eric Smith .SH BUGS diff --git a/initopts.c b/initopts.c index 16c5657..796e900 100644 --- a/initopts.c +++ b/initopts.c @@ -29,7 +29,8 @@ void usage (void) " -c Commodore 64\n" " options: -a assembly output\n" " -p predefs\n" - " -v
alternate vector address\n", + " -v
alternate vector address\n" + " -7 mask character data to 7-bit", progname); exit (1); } @@ -81,6 +82,9 @@ void initopts (int argc, char *argv[]) case 'b': bopt = ATARI_BOOT; break; + case '7': + sevenbit = 1; + break; default: crash("Invalid option letter"); } } diff --git a/main.c b/main.c index ccd940d..99e5df1 100644 --- a/main.c +++ b/main.c @@ -1,9 +1,34 @@ +/* + * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith + * + * $Id: main.c,v 1.7 2003/09/15 21:46:32 eric Exp $ + * Copyright 2000-2003 Eric Smith + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. Note that permission is + * not granted to redistribute this program under the terms of any + * other version of the General Public License. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA + */ + + #include #include #include #include "dis.h" +int sevenbit = 0; /* if true, mask character data with 0x7f to ignore MSB */ + #define NTSTART 500 char *cur_file = NULL; /* the file thats open */ diff --git a/print.c b/print.c index a03aaca..160d7a8 100644 --- a/print.c +++ b/print.c @@ -1,3 +1,26 @@ +/* + * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith + * + * $Id: print.c,v 1.7 2003/09/15 21:46:32 eric Exp $ + * Copyright 2000-2003 Eric Smith + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. Note that permission is + * not granted to redistribute this program under the terms of any + * other version of the General Public License. + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111 USA + */ + + #include #include #include @@ -116,6 +139,8 @@ void dumpitout (void) int pchar (int c) { + if (sevenbit) + c &= 0x7f; if (isascii(c) && isprint(c)) return(c); return('.');