diff --git a/dis.h b/dis.h index 607678d..f4738f1 100644 --- a/dis.h +++ b/dis.h @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: dis.h 26 2004-01-17 23:28:23Z eric $ - * Copyright 2000-2016 Eric Smith + * Copyright 2000-2018 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 @@ -21,7 +20,7 @@ */ -extern int sevenbit; /* if true, mask character data with 0x7f +extern bool sevenbit; /* if true, mask character data with 0x7f to ignore MSB */ typedef uint16_t addr_t; @@ -41,6 +40,10 @@ extern int base_address, vector_address; extern int entry_count; extern int entry_address[MAX_ENTRY]; + +extern bool prodos; + + extern int asmout; extern unsigned char f[]; extern unsigned char d[]; diff --git a/initopts.c b/initopts.c index f33345c..f5bb146 100644 --- a/initopts.c +++ b/initopts.c @@ -1,10 +1,8 @@ /* - * - * dis [-p predefineds] file - * - * The -p option may be repeated. + * Copyright 2001-2018 Eric Smith */ +#include #include #include #include @@ -37,7 +35,8 @@ void usage (void) " -p predefs\n" " -e
alternate entry point address\n" " -v
alternate vector address\n" - " -7 mask character data to 7-bit", + " -7 mask character data to 7-bit\n" + " -P decode ProDOS MLI calls\n", progname); exit (1); } @@ -96,7 +95,10 @@ void initopts (int argc, char *argv[]) bopt = ATARI_BOOT; break; case '7': - sevenbit = 1; + sevenbit = true; + break; + case 'P': + prodos = true; break; default: crash("Invalid option letter"); } diff --git a/lex.l b/lex.l index 1899887..8ff4075 100644 --- a/lex.l +++ b/lex.l @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: lex.l 26 2004-01-17 23:28:23Z eric $ - * Copyright 2001-2014 Eric Smith + * Copyright 2001-2018 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 @@ -23,6 +22,7 @@ %{ #undef ECHO +#include #include #include #include diff --git a/main.c b/main.c index cdf1077..20e51a6 100644 --- a/main.c +++ b/main.c @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: main.c 26 2004-01-17 23:28:23Z eric $ - * Copyright 2000-2016 Eric Smith + * Copyright 2000-2018 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 @@ -21,6 +20,7 @@ */ +#include #include #include #include @@ -28,7 +28,8 @@ #include "dis.h" -int sevenbit = 0; /* if true, mask character data with 0x7f to ignore MSB */ +bool sevenbit = false; /* if true, mask character data with 0x7f to ignore MSB */ +bool prodos = false; #define NTSTART 500 @@ -122,6 +123,18 @@ void trace_inst (addr_t addr) break; } + // handle ProDOS MLI calls + if (prodos && (opcode == 0x20) && (operand == 0xbf00)) + { + f[addr++] |= TDONE; // system call number + uint16_t parameter_list = getword(addr); + f[addr++] |= TDONE; + f[addr++] |= TDONE; + f[parameter_list] |= DREF; + save_ref(istart, operand); + continue; + } + /* Mark data references */ switch (ip->flag & ADRMASK) diff --git a/print.c b/print.c index a049a91..1a3f25c 100644 --- a/print.c +++ b/print.c @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: print.c 26 2004-01-17 23:28:23Z eric $ - * Copyright 2000-2014 Eric Smith + * Copyright 2000-2018 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 @@ -20,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ - +#include #include #include #include @@ -247,7 +246,7 @@ int print_data (addr_t i) i++; for (j = 1; j < 8; j++) { - if (f[i] & (JREF | SREF | DREF) || ((f[i] & LOADED) == 0)) + if (f[i] & (JREF | SREF | DREF | ISOP) || ((f[i] & LOADED) == 0)) break; else printf(",$%02x", getbyte(i)); diff --git a/ref.c b/ref.c index 879ddb1..5a40156 100644 --- a/ref.c +++ b/ref.c @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: ref.c,v 1.5 2003/09/15 21:49:25 eric Exp $ - * Copyright 2001-2003 Eric Smith + * Copyright 2001-2018 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 @@ -21,6 +20,7 @@ */ +#include #include #include diff --git a/tbl.c b/tbl.c index ef179eb..c42f56e 100644 --- a/tbl.c +++ b/tbl.c @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: tbl.c 26 2004-01-17 23:28:23Z eric $ - * Copyright 2001-2014 Eric Smith + * Copyright 2001-2018 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 @@ -20,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ - +#include #include #include diff --git a/trace_queue.c b/trace_queue.c index 332473c..dc8852f 100644 --- a/trace_queue.c +++ b/trace_queue.c @@ -1,8 +1,7 @@ /* * dis6502 by Robert Bond, Udi Finkelstein, and Eric Smith * - * $Id: trace_queue.c,v 1.2 2003/09/15 21:49:25 eric Exp $ - * Copyright 2000-2003 Eric Smith + * Copyright 2000-2018 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 @@ -20,7 +19,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA */ - +#include #include #include #include "dis.h"