Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
"option offset,begin,end,bus,interleave" info file statements preceding a "file" statement should work now
  • Loading branch information
Arakula committed May 20, 2022
1 parent 41542c8 commit b82caed
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 42 deletions.
35 changes: 0 additions & 35 deletions Dasm6500.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,6 @@
/* Copyright (C) Hermann Seib *
***************************************************************************/

#if 0
Little TODO notepad ...

"<" and ">" for forced addressing modes are obviously not used in the 6502
assembler world. So be it. There seem to be other methods:

Kick: append .abs or .a to the mnemonic (Absolute mode) or
append .zp or .z to the mnemonic (Zeropage mode)

dasm: .a, .z (plus various others) FORCE mnemonic extensions

ACME: append +1 (zeropage), +2 (absolute 16bit), +3 (absolute 24bit for 65816)
to mnemo

as65: nothing to be found in the manual

Most, if not all, of the above assemblers would also interpret constants
given with leading zeroes (like $00xx) as implicit absolute and without ($xx)
as zero page addressing, but that is not something I'd rely on. Also, it's
only usable for constants and equates - but not, for example, labels in
the zero page.

For the moment, I'm going with .a and .z, but that is surely not enough.
as65, for example, obviously can't handle that.

To go for maximum compatibility, options would be necessary to define
- whether forced addressing is to be done at all (OK, got that)
- a potential mnemonic addition (like the .a and .z currently in use)
- a potential parameter prefix (like the < and > of old)
The "$00 means zero page, $0000 means absolute address" approach is not
something that can be easily incorporated (and, as mentioned, incomplete),
so I see neither reason nor a way to implement that.

#endif

/*****************************************************************************/
/* Dasm650X.cpp : 650X disassembler implementation */
/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion Dasm6800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ switch (mode) /* which mode is this? */
dp = 0;
}
#if 1
if (forceExtendedAddr && (W & (uint16_t)0xff00) == (uint16_t)dp ||
if ((forceExtendedAddr && (W & (uint16_t)0xff00) == (uint16_t)dp) ||
GetForcedAddr(PC))
AddForced(smnemo, slbl, true);
sparm = slbl;
Expand Down
2 changes: 1 addition & 1 deletion Dasm6809.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@ switch (mode) /* which mode is this? */
if (dp == DEFAULT_ADDRESS)
dp = 0;
#if 1
if (forceExtendedAddr && (W & (uint16_t)0xff00) == (uint16_t)dp ||
if ((forceExtendedAddr && (W & (uint16_t)0xff00) == (uint16_t)dp) ||
GetForcedAddr(PC))
AddForced(smnemo, slbl, true);
sparm = slbl;
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ all: $(PROGS)

dasmfw: $(OBJS)
$(CXX) $(CPPFLAGS) -o $@ $^
#Here's some things you could do now ...
# ln -s dasmfw dasmhc11
# ln -s dasmfw dasm6809

%.o: %.cpp
$(CXX) $(CPPFLAGS) $(<) -c -o $@

.PHONY clean:
rm $(OBJS)
rm $(PROGS)
# rm $(PROGS)
16 changes: 14 additions & 2 deletions dasmfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ do
adr_t offs, ign;
ParseInfoRange(value, offs, ign, ign);
if (offs != NO_ADDRESS)
saFNames.push_back(sformat("-offset:0x%x", offs));
saFNames.push_back(sformat("-offset:0x%lx", offs));
saFNames.push_back(fn);
}
break;
Expand All @@ -1500,7 +1500,19 @@ do
if (idx == value.npos) idx = value.size();
option = value.substr(0, idx);
value = triminfo(value.substr(idx));
ParseOption(option, value, !bProcInfo);
if (!bSetDasm &&
!bProcInfo && /* if just loading includes and files*/
(option == "offset" || /* and "offset",... comes in */
option == "begin" ||
option == "end" ||
option == "interleave" ||
option == "bus"))
{
if (!value.empty()) /* append it to file list */
saFNames.push_back(sformat("-%s:%s", option.c_str(), value.c_str()));
}
else
ParseOption(option, value, !bProcInfo);
}
break;
case infoRemap : /* REMAP addr[-addr] offset */
Expand Down
2 changes: 1 addition & 1 deletion dasmfw.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using namespace std;
/* Global definitions */
/*****************************************************************************/

#define DASMFW_VERSION "0.28"
#define DASMFW_VERSION "0.29"

// set these to int64_t once 64bit processors become part of the framework
typedef uint32_t cadr_t; /* container for maximal code address*/
Expand Down
4 changes: 3 additions & 1 deletion history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,6 @@ v0.27 2022-05-10 relc directive added
v0.28 2022-05-18 crude fix for https://github.com/Arakula/dasmfw/issues/8
added 2 options for the 680X and 650X disassemblers to set
up a pattern for forced direct(zeropage) and extended(absolute)
addressing
addressing
v0.29 2022-05-20 "option offset,begin,end,bus,interleave" info file statements preceding
a "file" statement should work now

0 comments on commit b82caed

Please sign in to comment.