BLOAD: BASICA --> QBASIC 
Author Message
 BLOAD: BASICA --> QBASIC

        I am rewriting a old BASICA program for a friend in QBASIC (I don't
have the time or energy to rewrite it in a better language.)
        My problem is this:  The program relies a great deal on machine
address calls to retrieve information such as time, etc.  While I can get the
code to compile in QBASIC (I made the appropriate CALL ABSOLUTE changes), the
code will not run.
        When I step through it, the machine will hang every time it encounters
the line:   BLOAD "timer.m",vaptr%
        Timer.m is an assembly based set of instructions from what I am told,
and I know that it works fine with the exact same code in BASICA.  Any idea
why it does not work in QBASIC?

        Any ideas would be GREATLY appreciated.

        -- Mike



Tue, 30 Jun 1998 03:00:00 GMT  
 BLOAD: BASICA --> QBASIC

Quote:

>    When I step through it, the machine will hang every time it encounters
> the line:   BLOAD "timer.m",vaptr%

Chances are you're BLOADing the data into an array, yes?  In BASICA,
arrays are kept in Basic's default data segment.  In QBasic, arrays are
stored in far memory.  You must use DEF SEG to set the segment to the
array's segment (obtained via VARSEG) before using BLOAD, e.g.,

        DEF SEG = VARSEG(CodeArray(0))
        BLOAD "timer.m", VARPTR(CodeArray(0))

..to load the data in the file "timer.m" into the array CodeArray.

---
Glen Blankenship



Wed, 01 Jul 1998 03:00:00 GMT  
 BLOAD: BASICA --> QBASIC

 > I am rewriting a old BASICA program for a friend in QBASIC (I don't
 > have the time or energy to rewrite it in a better language.)

 Huh, why bother then. What kind of post is this? Your in the basic echo,
 and your bold enough to say you think BASIC sucks? Why don't you post
 a message consisting of "Feminism sucks!" in alt.feminists? If you
 want help, ask. If you want to disgrace BASIC, use alt.i.am.an.idiot.

 > My problem is this:  The program relies a great deal on machine
 > address calls to retrieve information such as time, etc.  While I can get
 > the code to compile in QBASIC (I made the appropriate CALL ABSOLUTE
 > changes), the code will not run.

 That must be some trick, considering QBasic is an interpreter. 8-)

 > When I step through it, the machine will hang every time it encounters
 > the line:   BLOAD "timer.m",vaptr%
 > Timer.m is an assembly based set of instructions from what I am told,
 > and I know that it works fine with the exact same code in BASICA.  Any
 > idea why it does not work in QBASIC?

 Because (GW)BASIC(A) only used 1 segment, QBasic uses multiple segments.
 You need to use the DEF SEG and VARSEG() routines to set the appropriate
 memory segment before BLOADING the routine. also note that strings from
 the 2 are not 100% compatable, (GW)BASIC(A) used a 1 byte descriptor
 length and QBASIC uses a 2byte descriptor length.



Wed, 01 Jul 1998 03:00:00 GMT  
 BLOAD: BASICA --> QBASIC




 > > I am rewriting a old BASICA program for a friend in QBASIC (I don't
 > > have the time or energy to rewrite it in a better language.)

 > > Huh, why bother then. What kind of post is this? Your in the basic

 [...SNIP...]

 > Save your sarcasm. If you disagree, use some structured reasoning to
 > explain yourself rather than attacking someone. And besides -- as my old

   [...SNIP]

 I take it posting off-topic flames is structured reasoning to you?
 I don't believe disgracing basic is a topic of discussion here.

 > QBASIC/QuickBASIC use 4 byte descriptor length. I think GWBASIC/BASICA
 > use 2 byte descriptor length.

 No Mark, GWBASIC uses a 3Byte descriptor, 1 Byte is the length of
 the string, the other is the offset address. QBasic uses a 4Byte
 descriptor, 2 Bytes for Length, 2 Bytes for the offset. The difference
 lies in the _descriptor length field_, sorry I forgot to use "field" the
 first time around.



Thu, 02 Jul 1998 03:00:00 GMT  
 BLOAD: BASICA --> QBASIC


Quote:


> > I am rewriting a old BASICA program for a friend in QBASIC (I don't
> > have the time or energy to rewrite it in a better language.)

> Huh, why bother then. What kind of post is this? Your in the basic echo,
> and your bold enough to say you think BASIC sucks? Why don't you post
> a message consisting of "Feminism sucks!" in alt.feminists? If you
> want help, ask. If you want to disgrace BASIC, use alt.i.am.an.idiot.

Save your sarcasm. If you disagree, use some structured reasoning to
explain yourself rather than attacking someone. And besides -- as my old
Biology teacher used to say, "Sucking a good thing, you see -- babies
always suck on things and that's how they we all used to eat when we were
little -- if it weren't for sucking, we'd all be hungry to death."

Quote:
> > When I step through it, the machine will hang every time it encounters
> > the line:   BLOAD "timer.m",vaptr%
> > Timer.m is an assembly based set of instructions from what I am told,
> > and I know that it works fine with the exact same code in BASICA.  Any
> > idea why it does not work in QBASIC?

> Because (GW)BASIC(A) only used 1 segment, QBasic uses multiple segments.
> You need to use the DEF SEG and VARSEG() routines to set the appropriate
> memory segment before BLOADING the routine. also note that strings from
> the 2 are not 100% compatable, (GW)BASIC(A) used a 1 byte descriptor
> length and QBASIC uses a 2byte descriptor length.

QBASIC/QuickBASIC use 4 byte descriptor length. I think GWBASIC/BASICA use
2 byte descriptor length.

-Mark



Thu, 02 Jul 1998 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Basica -> Qbasic

2. BASICA --> QBASIC conversion

3. Anyone have a qbasic or basica Terminal Program ????

4. Migrating from BASICA.COM to QBASIC.EXE

5. Looking for QBasic and BASICA stuff

6. Need help turning basica binary into qbasic ascii!!!

7. POKE values for BASICA or QBASIC

8. I WILL MAKE YOU BASICA(GWBASIC)/QBASIC a EXE

9. I WILL MAKE YOUR BASICA(GWBASIC)/QBASIC a EXE

10. BASICA -->Quickbasic

11. Wanted >>QBasic Tips For Notebook Page on Kenneth Green's Homepage

12. QBasic ->VBasic ->file.exe

 

 
Powered by phpBB® Forum Software