Execute a basic program without "run"

Por Ada

Resident (49)

Imagen del Ada

05-05-2005, 17:22

Hi! Smile

I want to know how to execute a basic listing without using the "run" command. I've tried to change CURLIN system variable but nothing changed. I suppose there must be a system variable that indicates the interpreter that the basic program is running, but can't find that. The goal is to launch a basic program from an assembler program.

Btw, I've seen basic listings are stored in 32769, but what is the function for address 32768? If I poke anything else than a zero there, I can't execute the program with "run".

Many thanks! Smile

Login sesión o register para postear comentarios

Por flyguille

Prophet (3031)

Imagen del flyguille

05-05-2005, 19:15

first, which is the previous basic's status.

i only can imagine one scenary... and it is a BASIC's listing switcher.

How is that?...

it consists in writing an assembler program (at page 3) that handling the PAGE 2 it switch the current basic's listing.

But in that case, normaly that piece of assembler code is loaded from an Basic's listing like a loader... So, de BASIC's interpreter is already runing a listing.

there is no only CURLIN, also the pointers to that line, because CURLIN iirc stores only the current line number like 10 or 20, but it is only for GOSUB/RETURN/errors message/CONT/ONxxxGOSUB purposes.

There is others several pointers to the start/end position of that line number at memory.

And if you switch listings, also is needed to upgrade the start/end pointers of the variable's area (both), end program pointer. etc. etc. etc.

Por flyguille

Prophet (3031)

Imagen del flyguille

05-05-2005, 19:17

now, if you means, about, THE basic is in DIRECT MODE, and i WANT to ORDER THAT BASIC's executes a program.... i thinks the only one way is to call to a internal function or something..

A trick, is to insert in the keyboard buffer

[CL] + RUN"XXXX" * [RETURN].

If the assembler code is in background like hooked to the interrupt.

Por Guillian

Prophet (3516)

Imagen del Guillian

05-05-2005, 22:40

perhaps a DEFUSR=&h73AC:?USR(0)

Por flyguille

Prophet (3031)

Imagen del flyguille

05-05-2005, 22:43

is that address standarized?

Por Guillian

Prophet (3516)

Imagen del Guillian

05-05-2005, 22:48

I don't think so, since it is not a BIOS entry or similar. But seems to work ok.

Por Ada

Resident (49)

Imagen del Ada

05-05-2005, 22:54

Thx, flyguille, I'm going to test your trick right now. In fact, I'm trying to make a hybrid asm-basic 32 kb rom (asm in page 1 and basic in page 2).

Cheers!

Por Ada

Resident (49)

Imagen del Ada

05-05-2005, 23:02

Thx to Guillian too! I'm testing right now, mounting the rom... I'll tell soon Smile

Por Ada

Resident (49)

Imagen del Ada

05-05-2005, 23:23

Cool! Both your tricks combined worked! Guillian, that address is supposed to be inside the basic interpreter. Do you know where is it from? What does it call?

Thanks! Smile

Por Guillian

Prophet (3516)

Imagen del Guillian

05-05-2005, 23:35

Yep, it is called when you use the ',R' in LOAD stament. So it just execute the loaded BASIC program