Page 4 of 8
Posted: Wed Oct 26, 2011 12:20 pm
by ElEctric_EyE
Way above my head, sorry.
I assume you're talking about modifying an .exe file?
Posted: Wed Oct 26, 2011 12:23 pm
by Arlet
Way above my head, sorry.
I assume you're talking about modifying an .exe file?
No. You mentioned nmake, so I figured you were already using a makefile. The makefile is a small text file that nmake uses to figure out what to build, when to build it, and what tools to use.
Posted: Wed Oct 26, 2011 1:49 pm
by ElEctric_EyE
Ok, yes I see that now.
Bitwise has shown me how to modify it to
extend the pure binary file size. Now I'll try what you suggested. Doesn't like the syntax I've entered from your example, but I'll mess with it for abit..
EDIT: Added link, corrected link, recorrected.
Posted: Wed Oct 26, 2011 2:47 pm
by ElEctric_EyE
I forgot the TAB...
Something is working, no errors. But it isn't creating the .bin or .coe
Posted: Wed Oct 26, 2011 7:56 pm
by ElEctric_EyE
Ok, here is the Makefile:
Code: Select all
#===============================================================================
# Portable 6502/65C02/65816 Assembler Definitions
#-------------------------------------------------------------------------------
# Update the followiung line to reflect where you have installed the ZIP file
# containing the JAVA classes.
65016_DIR = .
#===============================================================================
65016_JAR = $(65016_DIR)/65016.jar
AS65_CLASS = org.x6502.x65016.As65016
LK65_CLASS = org.x6502.x65016.Lk65016
LB65_CLASS = org.x6502.x65016.Lb65016
AS65 = java -cp $(65016_JAR) $(AS65_CLASS)
LK65 = java -cp $(65016_JAR) $(LK65_CLASS)
LB65 = java -cp $(65016_JAR) $(LB65_CLASS)
RM = erase
#===============================================================================
# Rules
#-------------------------------------------------------------------------------
.asm.obj:
$(AS65) $(AS65_FLAGS) $<
#===============================================================================
# Configuration
#-------------------------------------------------------------------------------
OBJS = \
boot.obj
LK65_FLAGS = \
-bss $$00010000-$$EFFFFFFF -code $$FFFFE000-$$FFFFFFFF
#===============================================================================
# Targets
#-------------------------------------------------------------------------------
all: boot.s19 boot.hex boot.bin boot.coe
boot.s19: $(OBJS)
$(LK65) $(LK65_FLAGS) -s19 -output $@ $(OBJS)
boot.hex: $(OBJS)
$(LK65) $(LK65_FLAGS) -hex -output $@ $(OBJS)
boot.bin: $(OBJS)
$(LK65) $(LK65_FLAGS) -bin -output $@ $(OBJS)
#===============================================================================
# Utilities
#-------------------------------------------------------------------------------
clean:
$(RM) $(OBJS)
$(RM) *.bin
$(RM) *.s19
$(RM) *.lst
$(RM) *.map
$(RM) *.coe
#===============================================================================
# Dependencies
#-------------------------------------------------------------------------------
boot.obj: \
boot.asm
boot.bin: boot.coe
bin2coe -2 boot
Posted: Wed Oct 26, 2011 8:35 pm
by BigEd
I'm tempted to say that should be the other way around:
because makefiles take the form
Code: Select all
to make something: you need this and that
mangle this and that making something
Posted: Wed Oct 26, 2011 9:09 pm
by ElEctric_EyE
I'm tempted to say that should be the other way around:
because makefiles take the form
Code: Select all
to make something: you need this and that
mangle this and that making something
You are correct BigEd! It finally works!!!
Putting Arlet's bin2coe.exe inside of Bitwises' 65016 Folder, with the
following Makefile does indeed create an 8Kx16 "boot.coe" file necessary for generating a ROM for the ISE Core Generator. Using the "nmake" command will now make the .bin file and the .coe file as Arlet originally suggested. So anyone can check the .bin in a hex editor, and check the .coe in a text editor and compare against the original boot.asm...
Many Thanks Gentlemen!
Code: Select all
LB65_CLASS = org.x6502.x65016.Lb65016
AS65 = java -cp $(65016_JAR) $(AS65_CLASS)
LK65 = java -cp $(65016_JAR) $(LK65_CLASS)
LB65 = java -cp $(65016_JAR) $(LB65_CLASS)
RM = erase
#===============================================================================
# Rules
#-------------------------------------------------------------------------------
.asm.obj:
$(AS65) $(AS65_FLAGS) $<
#===============================================================================
# Configuration
#-------------------------------------------------------------------------------
OBJS = \
boot.obj
LK65_FLAGS = \
-bss $$00010000-$$EFFFFFFF -code $$FFFFE000-$$FFFFFFFF
#===============================================================================
# Targets
#-------------------------------------------------------------------------------
all: boot.s19 boot.hex boot.bin boot.coe
boot.s19: $(OBJS)
$(LK65) $(LK65_FLAGS) -s19 -output $@ $(OBJS)
boot.hex: $(OBJS)
$(LK65) $(LK65_FLAGS) -hex -output $@ $(OBJS)
boot.bin: $(OBJS)
$(LK65) $(LK65_FLAGS) -bin -output $@ $(OBJS)
#===============================================================================
# Utilities
#-------------------------------------------------------------------------------
clean:
$(RM) $(OBJS)
$(RM) *.bin
$(RM) *.s19
$(RM) *.lst
$(RM) *.map
$(RM) *.coe
#===============================================================================
# Dependencies
#-------------------------------------------------------------------------------
boot.obj: \
boot.asm
boot.coe: boot.bin
bin2coe -2 boot
Posted: Thu Oct 27, 2011 9:42 am
by ElEctric_EyE
It does work, but I have to delete all the files it makes before I run it again.
Posted: Thu Oct 27, 2011 10:42 am
by BitWise
It does work, but I have to delete all the files it makes before I run it again.
Make checks the timestamps of the referenced files to determine of anything has changed. It only rebuilds when it needs to.
To force a rebuild you need to update the timestamp on the source file (e.g. make a simple edit and re-save - On unix there is a 'touch' command to update a file's timestamp)
Posted: Thu Oct 27, 2011 11:13 am
by Arlet
It does work, but I have to delete all the files it makes before I run it again.
Yes, that's the idea behind 'make'. You write a 'makefile' with all the dependencies in the form Ed suggested, and the 'make' program figures out what to do.
So, if you say that 'file.coe' depends on 'file.bin', and 'file.bin' hasn't changed, it knows that 'file.coe' is still valid, and it won't build it again.
As long as you've correctly stated all your dependencies, you don't have to delete any files to force a remake.
Posted: Thu Oct 27, 2011 11:49 am
by Tor
It does work, but I have to delete all the files it makes before I run it again.
In addition to what Arlet said about getting dependencies right, you also have a 'clean' target in your makefile, which means you can delete all the files in one go: 'make clean' (or is it 'nmake clean' on your platform? Anyway, that's the method for executing a specific target in the makefile. If you don't specify any then it'll choose the first (topmost) one, which is that 'all:' target in your case.)
-Tor
Posted: Fri Oct 28, 2011 6:24 am
by BigEd
I think also you can use
or, if you're using GNU make
to ask it to do everything regardless of timestamps - in a small case like this, that's reasonable. In a bigger project, that means it's time for a cup of tea or a walk around the block.
(You wouldn't normally need to do this, if you've written your rules right, but it can be useful.)
Cheers
Ed
Posted: Fri Oct 28, 2011 11:13 pm
by ElEctric_EyE
Ok, I understand now. I did a couple of tests... I guess I didn't realize before running NMAKE that it would not have "gone through the paces" if the code was not modified, since I was always modifying the boot.asm and running NMAKE as a normal procedure.
It's nice to know this part of the project is all running as it should. Now I'll go back to concentrating on problems I am having elsewhere.
Trying to bring a few parts together here, but it's good to have knowledgeable help, thanks for all the input.

Posted: Tue Dec 06, 2011 1:05 am
by ElEctric_EyE
I'm focusing now on a 4Kx8 bit of programming called HESMON. It has the same features as Micromon and SuperMON and after skimming through it quickly now many times, I'll feel more comfortable trying to modify it. I've run the image I have through VICE and it works.
It has a couple calls to the C64 Basic ROM. I will have to look at these first and foremost....
Posted: Tue Dec 06, 2011 9:41 am
by BigEd
A word of caution: these VIC20 and C64 monitors might make assumptions about having a certain layout of display, especially if they offer scrolling views of memory. You'll be fine if you have a layout just like a C64 of course.
(Over the weekend I had a quick look at '
sykes', an obfuscated C PET emulator for the 2005 contest. It has a small 6502 test suite, but sadly that doesn't have a readily separable I/O routine: it expects to handle a character-mapped display at $8000.)
Cheers
Ed