Calling BASIC from assembly..

Everything about programming, including VDP and Sound programming.
Post Reply
gilmo
Posts: 15
Joined: 03 Nov 2024 12:09

Calling BASIC from assembly..

Post by gilmo »

how would you call the BASIC interpreter to execute a command from inline assembly ?

something like this ..

10 code
4007 LD HL, Command ; HL points to the BASIC command string
400A CALL #2400 ; Call BASIC interpreter to execute the command
400C RET ; Return to BASIC
400D Command: DB "PRINT "HELLO FROM ASM"", 0


I can't find the EXACT Rom subroutines call address , tried #2400, #2500 and others .. is there a detailed subroutines-documentation for ROM calls somewhere ?!


This is what I was able to find in general:

0x2100 - 0x21FF: Memory management routines, including setting up memory pages and handling memory access.

0x2200 - 0x22FF: Input/output routines, such as reading from the keyboard, writing to the display, and handling disk operations.

0x2300 - 0x23FF: System control routines, including resetting the system, handling interrupts, and managing system resources.

0x2400 - 0x24FF: BASIC interpreter routines, which handle the execution of BASIC programs and commands.

0x2500 - 0x25FF: Assembly language support routines, including machine code execution and interfacing with BASIC.
Bill B
Posts: 619
Joined: 26 Jan 2014 16:31

Re: Calling BASIC from assembly..

Post by Bill B »

There is no complete documentation of the MTX ROM.

The ReSource manual describes a few useful entry points.

You may also find some information in the various other books and magazines on Dave's site.

Otherwise you have to read the ROM source listings from Andy Key's site:
If you find anything interesting, you might contribute an addition to ReSource for the benefit of others.
gilmo
Posts: 15
Joined: 03 Nov 2024 12:09

Re: Calling BASIC from assembly..

Post by gilmo »

Thanks Bill,

Yes, I looked at Resource2022 before, couldn't find entry points related to calling the basic interpreter..

the ROM sources are interesting .. I will search through it and hopefully find something :)
gilmo
Posts: 15
Joined: 03 Nov 2024 12:09

Re: Calling BASIC from assembly..

Post by gilmo »

..The only related entry points I found in ROM sources were these:

basic -- #259
basics -- #205 -- new page/reset
basics1 -- #244
basics2 -- #250
basics4 -- #24A
..and dobasic .. #2116 , #2118


what I'm trying to do is .. read bytes from the SDX floppy in assembly .. or hybrid (assy/basic) method..

is there an assembly example OUT THERE on how to use the BASIC command "USER READ <file.dat>" from the assembler?

code snippet below, but it doesn't yield the desired results .. basic does not execute the next line after the interpreted call.. (PC) not preserved
Attachments
testing.zip
(2.61 KiB) Downloaded 88 times
0001.png
0001.png (2.34 KiB) Viewed 1515 times
Post Reply