Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Tools/as65c/SOURCE_CODE/as65c/as65c.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

parser.add_argument("-l", dest="LARG", action="store_true", help="unknown as of this time")

parser.add_argument("-o", dest="relfile", type=str, help="Output rel file to produce")



Expand Down Expand Up @@ -82,11 +83,13 @@
if FILE[-4:].lower() == ".rel":
FILE = FILE[:-4] + ".asm"

relfile = ARGS.get("relfile", None)

print_verbose = False
if ARGS["p_verbose"] == True:
print_verbose = True




assembler.assembleFile(FILE, optional_args, force_assemble=force_assembly, print_verbose=print_verbose)
assembler.assembleFile(FILE, optional_args, force_assemble=force_assembly, print_verbose=print_verbose, relfile=relfile)
11 changes: 7 additions & 4 deletions Tools/as65c/SOURCE_CODE/as65c/assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ def MAKE_ASM_LINES(self, filename, include_level=0):



def assembleFile(filename, ext_vars={}, force_assemble=False, check_hash=False, print_verbose=False):
def assembleFile(filename, ext_vars={}, force_assemble=False, check_hash=False, print_verbose=False, relfile=None):

global EXTERNAL_SYMBOLS
global data_page
Expand Down Expand Up @@ -561,6 +561,9 @@ def assembleFile(filename, ext_vars={}, force_assemble=False, check_hash=False,
#FILE_PATH = "/".join(filename.split("/")[:-1]) + "/"

FILE_PATH, FILE_NAME = get_file_attrs(filename)
if not relfile:
relfile = FILE_PATH + FILE_NAME.split(".")[0] + ".rel"


succeeded = False
hash_text = ""
Expand All @@ -574,7 +577,7 @@ def assembleFile(filename, ext_vars={}, force_assemble=False, check_hash=False,

if not force_assemble:
try:
f = open(FILE_PATH + FILE_NAME.split(".")[0] + ".rel")
f = open(relfile)

f.close()
except:
Expand Down Expand Up @@ -4221,7 +4224,7 @@ def WRITE_LIS():
TEST_OFFS = 0
P_TEST_OFFS = 0
PREV_LINE = 0
with open(FILE_PATH + FILE_NAME.split(".")[0] + ".lis", "w") as LIS_FILE:
with open(relfile.rsplit(".", 1)[0] + ".lis", "w") as LIS_FILE:
for S in sections:
PREV_LINE = 0
L_IND = -1
Expand Down Expand Up @@ -4931,7 +4934,7 @@ def WRITE_LIS():

start = util.get_time()

with open(FILE_PATH + FILE_NAME.split(".")[0] + ".rel", "wb") as REL_FILE:
with open(relfile, "wb") as REL_FILE:
L = len(REL_DATA)
out_bytes = []
for ind in range(L):
Expand Down