It is currently Mon Oct 20, 2014 4:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jan 02, 2011 3:54 am 
Offline
User avatar
 WWW  Profile

Joined: Mon Mar 15, 2010 2:28 pm
Posts: 42
Location: Minehead, Somerset (UK)
Well, to be fair, I think I'm making it do things it's not designed to do!

But I just thought I'd mention...

Code:
.start
ORG $7800
    equb 0

ORG $7FFC
    equb 00
    equb 20
    equb 00
    equb 20
.end
SAVE "dummyrom.bin", start, end


When I compiled that I expected to get a small file 2k in size all 0's with just the four bytes at the end. What I got instead was a 32k file all blank all the way up except for the four bytes at the end.

Like I say, clearly I'm twisting it and making it do something pretty unreasonable for an assembler but it seemed to me like a nice easy way of getting a ROM that only contained the interrupt / reset vectors :)

Obviously when I thought about it, I realised it was a bit dumb, changed my 1st ORG to 0, my 2nd ORG to $7FC and I got my file as I expected.


Top
 
PostPosted: Sun Jan 02, 2011 1:34 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
The problem is you've defined your first label before the ORG!

If not set, it defaults to an ORG of 0, and the label is set to whatever the current value is.

Try this instead:
Code:
ORG $7800
.start
    equb 0

ORG $7FFC
    equb 00
    equb 20
    equb 00
    equb 20
.end
SAVE "dummyrom.bin", start, end

:)

To be honest, one of my big influences in designing BeebAsm was to have absolute control over what is saved, so the sort of thing you're doing there is completely what I had in mind.

I have no idea what a different assembler would output given that source code (whether it would concatenate the two blocks to give a 5 byte file, whether it would output 2048 bytes, or do something else). That's why I liked the use of the SAVE directive inside the source code to specify exactly which it should output!


Top
 
PostPosted: Sun Jan 02, 2011 1:53 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Just an addendum to this: presumably if you were wishing to create a ROM containing some code and the 6502 hardware vectors, the addresses you actually need are $F800 and $FFFC? (or maybe does this hardware only use 15 address lines, and mirror the 32k block?)


Top
 
PostPosted: Sun Jan 02, 2011 2:04 pm 
Offline
User avatar
 WWW  Profile

Joined: Mon Mar 15, 2010 2:28 pm
Posts: 42
Location: Minehead, Somerset (UK)
Yes, A15 at the CPU just floats and the A15 input to the address decoding circuit is tie low so it's mirroring of sorts! Had me going for a while when I first started this wondering how on earth I was meant to get the vectors into FFFC, etc when the ROM space only went up as far as &7FFF :)


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron