BBC BASIC
« Address out of range »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 7:10pm


Cross-platform BBC BASIC (Win32, Linux x86, Android, Mac OS-X, Raspberry Pi)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Address out of range  (Read 179 times)
mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Address out of range
« Thread started on: Feb 20th, 2017, 1:38pm »

After testing a BBCSDL program using Windows, I am now starting to test it on a Mac.

One of the first things the program does is to find the length of a file (using OPENIN and EXT), use DIM to allocate memory, then load the file into memory (about 72KB) by using OSCLI("Load "+csv$+" "+STR$~csv%) where csv$ is the full filename and csv% the address.

On Windows this works fine, but on a Mac the Load fails with 'Address out of range'. It did seem rather large, and next time I have remote access to the Mac I will make a note what it is.

Any clues what this problem might be caused by please?
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 692
xx Re: Address out of range
« Reply #1 on: Feb 20th, 2017, 2:56pm »

on Feb 20th, 2017, 1:38pm, mavison wrote:
Any clues what this problem might be caused by please?

Not really. The only 'questionable' aspect of your code is that it appears not to be compatible with path names that contain spaces or other punctuation, but I would have expected paths of that kind to be less likely on a Mac rather than more so. Still, it would be desirable to add the necessary quotes for safety.

Some of the example programs do exactly what you are doing, and they work fine here. Notably clock.bbc (in the graphics folder) which contains the following code:

Code:
      clock$ = @dir$ + "clock.bmp"
      F% = OPENIN(clock$) : DIM clock% EXT#F% : CLOSE #F%
      OSCLI "LOAD """ + clock$ + """ " + STR$~clock% 

So one thing to check is whether clock.bbc works for you or not. If it doesn't, evidently the problem is related to some difference between your Mac and mine. If it does work you may want to investigate what the salient difference is between the two programs.

Richard.
« Last Edit: Feb 20th, 2017, 3:00pm by Richard Russell » User IP Logged

mavison
New Member
Image


member is offline

Avatar




PM


Posts: 27
xx Re: Address out of range
« Reply #2 on: Feb 20th, 2017, 2:57pm »

The address was hex 1003C99A & length 74552.

But I have fixed the problem by adding quotes round the filename for the Load - the directory had some spaces in it. So that must have confused it and me!!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Donate $6.99 for 50,000 Ad-Free Pageviews!


This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls