6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 7:58 pm

All times are UTC




Post new topic Reply to topic  [ 114 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: Wed Oct 26, 2011 12:20 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Way above my head, sorry.
I assume you're talking about modifying an .exe file?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 12:23 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
ElEctric_EyE wrote:
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 1:49 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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.


Last edited by ElEctric_EyE on Wed Oct 26, 2011 5:15 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 2:47 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
I forgot the TAB...
Something is working, no errors. But it isn't creating the .bin or .coe


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 7:56 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
Ok, here is the Makefile:
Code:
#===============================================================================
# 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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 8:35 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I'm tempted to say that should be the other way around:
Code:
boot.coe: boot.bin

because makefiles take the form
Code:
to make something: you need this and that
      mangle this and that making something


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 26, 2011 9:09 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
BigEd wrote:
I'm tempted to say that should be the other way around:
Code:
boot.coe: boot.bin

because makefiles take the form
Code:
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:
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 27, 2011 9:42 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
It does work, but I have to delete all the files it makes before I run it again.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 27, 2011 10:42 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
ElEctric_EyE wrote:
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)

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 27, 2011 11:13 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
ElEctric_EyE wrote:
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 27, 2011 11:49 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
ElEctric_EyE wrote:
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 28, 2011 6:24 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I think also you can use
Code:
  NMAKE /A
or, if you're using GNU make
Code:
  make -B
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 28, 2011 11:13 pm 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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. :)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 06, 2011 1:05 am 
Offline

Joined: Mon Mar 02, 2009 7:27 pm
Posts: 3258
Location: NC, USA
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....


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Dec 06, 2011 9:41 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 114 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: