It is currently Mon Oct 20, 2014 5:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Nov 06, 2008 3:46 am 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
Ok, bug first...

I'm attempting to assemble a copy of the rom from the 6502 second processor, this rom has it's code from F800-FFFF. The rom is assembling fine however when trying to generate the output file I'm using :-

SAVE "Client6502.rom",&F800,&FFFF

However this seems to miss off the last byte at FFFF, which is not saved to the output file. I tried specifying 10000 as the end address, but this as expected gave me an error message.

Next a request, would it be possible to have a simple way of declaring/filling a block of bytes with a single value ?

Finally what environment do I need to use to try and re-compile the assembler source code ? (under windows), I presume the standard unix tools can be used on Linux etc.

Cheers.

Phill.


Top
 
PostPosted: Thu Nov 06, 2008 7:57 am 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Hi Phill,

Thanks for the feedback. That is indeed a bug! I will release a new version which accepts an end address of &10000 - as per *SAVE on the Beeb, the block is saved up to, but not including, the end address. (As an aside, does *SAVE accept an end address of 10000, I wonder...?)

As for filling a block with a single value - for now, is the following convenient?:

Code:
FOR n, 1, length
  EQUB value
NEXT


I could create a special keyword to do this, but it seems slightly obscure.

Cheers,
Rich


Top
 
PostPosted: Thu Nov 06, 2008 8:04 am 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Oh, re compiling in Windows - yes, it's not as simple as opening a solution in Visual Studio as I wanted to keep the environment very neutral, using Makefiles as the build system, so that it would be as portable as possible.

I use MinGW (http://www.mingw.org), which is a Windows port of GCC, and GNU Make 3.81. Also install Cygwin in order to get some handy Unix-style executables, like rm, sed, etc. Don't use the Cygwin version of GCC though, as it carries a bit of extra baggage with it, and isn't so much designed for Windows as MinGW.

Then, provided you add MinGW and Cygwin to your Windows path, BeebAsm should just compile straight away as-is.

HTH!


Top
 
PostPosted: Thu Nov 06, 2008 10:02 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
RichTW wrote:
Oh, re compiling in Windows - yes, it's not as simple as opening a solution in Visual Studio as I wanted to keep the environment very neutral, using Makefiles as the build system, so that it would be as portable as possible.


That said, it is fairly trivial to get it building in Visual Studio if you want to...


Top
 
PostPosted: Thu Nov 06, 2008 2:46 pm 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
RichTW wrote:
Oh, re compiling in Windows - yes, it's not as simple as opening a solution in Visual Studio as I wanted to keep the environment very neutral, using Makefiles as the build system, so that it would be as portable as possible.

I use MinGW (http://www.mingw.org), which is a Windows port of GCC, and GNU Make 3.81. Also install Cygwin in order to get some handy Unix-style executables, like rm, sed, etc. Don't use the Cygwin version of GCC though, as it carries a bit of extra baggage with it, and isn't so much designed for Windows as MinGW.

Then, provided you add MinGW and Cygwin to your Windows path, BeebAsm should just compile straight away as-is.

HTH!


Humm I have those installed, but, looks like my mingw install might be borked, when I try and compile I get :-

Code:
Z:\Retro\Acorn\Utility source\beebasm\src>make all
Generating dependencies for ... symboltable.cpp
gcc: CreateProcess: No such file or directory
Generating dependencies for ... stringutils.cpp
gcc: CreateProcess: No such file or directory
Generating dependencies for ... sourcefile.cpp
gcc: CreateProcess: No such file or directory
Generating dependencies for ... objectcode.cpp
gcc: CreateProcess: No such file or directory


And so on.

I'll do a re-install later and see if that fixes it, odd it worked for compiling Mess last time I did that (couple of weeks back).

Cheers.

Phill.


Top
 
PostPosted: Thu Nov 06, 2008 2:52 pm 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
A couple of thoughts:

First of all, try compiling with

make code VERBOSE=1

so you can see what commands are being issued. (Perhaps you could paste the output here?)

Could it be that the space in your source path (Utility source) is causing trouble?

Also check that the MinGW\bin directory is higher up in your path than any other possible GCC version - just in case the wrong compiler's being invoked.

The makefile should work well with GNU Make 3.80 and 3.81 - so I doubt that's the problem.

Curious...


Top
 
PostPosted: Thu Nov 06, 2008 3:06 pm 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
hmmm a quick Google does seem to suggest that the problem would go away if you just reinstalled MinGW. Perhaps this is the most painless way to go!

That said, if you have Visual Studio, I'm sure you could probably just drop the source files into a new solution, and it would just work!


Top
 
PostPosted: Thu Nov 06, 2008 9:17 pm 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
RichTW wrote:
hmmm a quick Google does seem to suggest that the problem would go away if you just reinstalled MinGW. Perhaps this is the most painless way to go!

That said, if you have Visual Studio, I'm sure you could probably just drop the source files into a new solution, and it would just work!


Doing proper install from the Mingw distribution fixed it ! Seems that what the Mame/Mess team distribute is only a partial install.

Anway patched commands.cpp and changed the line :-
Code:
if ( end < 0 || end > 0xFFFF)

to

if ( end < 0 || end > 0x10000)


And that seems to fix the can't save the last byte bug :) BTW I can't remember if the documentation says so, but I think "end" is a little mis-leading as it's the first byte beyond the last to be saved, whereas I interpreted it as the last to be saved.

As for padding code then your sugestion of using a small for loop worked, the reason I asked was that in other assemblers that I have used you can do something like :-

DB $FF DUP $80

And get $80 bytes of $FF, maybe you should implement a FILLTO keyword used as
FILLTO &Addr,&Value.

Cheers.

Phill.


Top
 
PostPosted: Fri Nov 07, 2008 7:54 am 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Hi Phill

Perhaps I can put in a FILL or FILLTO if it'll be useful.

I don't know if you noticed but I released a new version of BeebAsm yesterday afternoon which fixes the bug you mentioned (and a similar one in CLEAR), as well as adding a bit of extra functionality to SAVE.

I can clarify the documentation regarding the end address... the behaviour is exactly the same as *SAVE on the Beeb - I just had a look in the AUG and noticed that its explanation of the meaning of the end address is just as vague as mine... I think the intention was that you could write:

Code:
.start
LDA blah
STA woops
RTS
.end

SAVE "Rubbish", start, end


and it would save exactly the right amount of code.

Anyway cheers for the comments, and good luck with the project!


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

All times are UTC [ DST ]


Who is online

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