Calling SuperBasic from Archive

Anything QL Software or Programming Related.
Post Reply
SH1
ROM Dongle
Posts: 12
Joined: Sun Feb 23, 2020 7:44 pm

Calling SuperBasic from Archive

Post by SH1 »

Dear All,

Does anyuone know if there is any way of calling either SuperBasic or Machine Code from with an Archive procedure or interupt?

I am suspecting the answer is going to be no, but hoping someone might know :)

Regards
Simon


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Calling SuperBasic from Archive

Post by NormanDunbar »

SuperBasic, no.
Assembly, maybe...

Not from archive itself, but there was another application named, I think, Archive Run Time, or similar. I seem to remember a review which mentioned being able to call assembly from that.

HTH and apologies for the vagueness!

Edit: https://qlwiki.qlforum.co.uk/doku.php?i ... devarchrtm

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
SH1
ROM Dongle
Posts: 12
Joined: Sun Feb 23, 2020 7:44 pm

Re: Calling SuperBasic from Archive

Post by SH1 »

Good evening Norm,

Ah, this is great, thank you. I had not thought of using this, as I only use Archive in its original form.

Shall have a play to-morrow and let you, if what I want to do is possible.

Regards
Simon


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: Calling SuperBasic from Archive

Post by dilwyn »

To expand on what Norman said, have a look at the Runtime Archive, manual and an example from Tony Firshman, on my site at http://www.dilwyn.me.uk/psions/index.html

It's near the bottom of the page, under '"Runtime QL Archive".

I've copied the following notes from the manual so you can get an idea of whether it'll do what you want:
4) Machine code interface

The Archive RTM and the full version of Archive provided with it support the use of machine code routines. They are interfaced to an Archive program by means of an additional usr() function and a usr qualifier to the Load command.

The machine code must be relocatable, that is, it must use only PC-relative addressing modes. In addition to the code, the file must contain a six-byte header. Bytes 0 to 3 must contain "pmcO" and bytes 4 and 5 must: be a word giving the length of the following code. It is the user's responsibility to ensure that the file has the correct header.

The machine code program (in image form, exactly as it would appear in memory) must follow the header, with its entry point at the byte immediately following the header. The code must end with a return from subroutine instruction.
Archrtm is the 'runtime' version, while Archdev is the full version, both are in the package.

The manual includes an example of how to play a simple beep sound from Archive.


SH1
ROM Dongle
Posts: 12
Joined: Sun Feb 23, 2020 7:44 pm

Re: Calling SuperBasic from Archive

Post by SH1 »

Good evening Dilwyn,

Thank you !

Some light reading for the Home Office :D

Regards
Simon


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Calling SuperBasic from Archive

Post by Derek_Stewart »

Hi,

I think this really hard to access SuperBASIC from Archive.

Archive has a programming language built into the application, which usually suits the average Archive user.

I offten thought about a SuperBASIC version of the Archive Database., but the effort is not really worth doing.

Maybe a better idea is to use the DBAS database extensions to SuperBASIC and SBASIC which extend the QLs programming environment. An application written in S*BASIC could be written and compiled with Qliberator very easily.

There are exisiting free application that will read DBAS dtat files: QBASE, Suqcess and the DBAS applications in the package.


Regards,

Derek
SH1
ROM Dongle
Posts: 12
Joined: Sun Feb 23, 2020 7:44 pm

Re: Calling SuperBasic from Archive

Post by SH1 »

Good evening Derek,

Many thanks for the tip. Agreed, the procedure language in Archive is actually quite good, but I have a problem with date manipulation.

For instance, I can not subtract 30 days from to-day's date and then display it as 28/12/2020.

I thought I could deploy a user-exit into SuperBasic, but I have now been playing with ARCDEV/RTM and shall see if I can get around it via this method.

Regards
Simon


Post Reply