6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Nov 04, 2024 9:07 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri Mar 06, 2020 12:38 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
I tried to moddify EhBasic by adding my own routines and some variables (including few located in zero page). But something strange happens, when I try to "burn" an EPRM. MiniProg informas me, that bin or hes file is outside programmed memory space. My program bagins at 0xC000 and ends at 0xFFFF (vectors). How to generate proper hex (or bin) file, containing only this fragment of memory space?


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 06, 2020 12:44 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Working with such limited information it can be hard to give you an answer. Attaching the file you generated would be very helpful, as would describing in detail the changes you made and how you generated the file.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 06, 2020 12:55 am 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1006
Location: Canada
How big is the HEX/binary file and what size is your EPROM? You may have produced an output file that represents the entire 64K of memory space.

Likely you will have to edit the HEX/Binary file to remove leading 0s so it fits into your EPROM from the top down. Or re-define how to build the output file in your assembler.

Another vote for posting the file here so we can have a look, and letting us know what you used to create it.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 06, 2020 6:13 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
As the most basic point, remember that there's a difference between the address range you design your code to appear in to the CPU, and the offset within the ROM that you need to burn it.

The assembler may be producing files (IHEX or SREC) which indicate the correct addresses, but your burning program doesn't know how to map those to offsets. Or you may be producing a raw hex or binary file without addresses, in which case all bets are off.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 06, 2020 7:37 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
Ok, I already found the cause. I had been using ORG statement to define variables, so assembler put them into bin file, with a lot of 0x00s between data and program. Then I've noticed that original EhBasic code uses EQ labels to define addresses of variables. Now generated hexes contain only a code, without variables.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 06, 2020 9:26 am 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 727
Location: Tokyo, Japan
Atlantis wrote:
Ok, I already found the cause. I had been using ORG statement to define variables, so assembler put them into bin file, with a lot of 0x00s between data and program. Then I've noticed that original EhBasic code uses EQ labels to define addresses of variables. Now generated hexes contain only a code, without variables.

You don't mention what assembler you were using or what pseudo-ops you were using to reserve space in the `ORG` sections, but with some assemblers, so long as you use reservation pseudo-ops such as DS rather than definition pseudo-ops such as DB, output will not be generated. Others may generate output (typically zeros) for that area, though they ought not.

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: