Run a SuperBasic program from Assembler?

Anything QL Software or Programming Related.
User avatar
t0nyt
Gold Card
Posts: 370
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Run a SuperBasic program from Assembler?

Post by t0nyt »

Managed to get my head around the config block stuff, in a small test harness

But it' doesn't seem to be appropriate to a LRESPR'd program of this sort, that I can see

Will just add an optional parameter to "menu" that can be an alternative path which is then stored in memory in-place of the default

Many thanks


User avatar
tofro
Font of All Knowledge
Posts: 2699
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Run a SuperBasic program from Assembler?

Post by tofro »

Config blocks work in just about everything, even S*BASIC programs. (It's plain simple, just some embedded bytes with a tag header so Config can find them. No obligation to use any specific compilation approach.)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
NormanDunbar
Forum Moderator
Posts: 2271
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Run a SuperBasic program from Assembler?

Post by NormanDunbar »

The official documentation for Config may also help. It's downloadable from Wolfgang's web site at https://www.wlenerz.com/qlstuff/Config.zip.

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.
User avatar
t0nyt
Gold Card
Posts: 370
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Run a SuperBasic program from Assembler?

Post by t0nyt »

NormanDunbar wrote: Mon Apr 01, 2024 2:17 pm The official documentation for Config may also help. It's downloadable from Wolfgang's web site at https://www.wlenerz.com/qlstuff/Config.zip.

Cheers,
Norm.
Thanks Norm

I did search the interweb for documentation but nothing came up in the search

Many thanks


User avatar
tofro
Font of All Knowledge
Posts: 2699
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Run a SuperBasic program from Assembler?

Post by tofro »

Unfortunately, Wolfgang's documentation describes the raw binary format expected by config. Tony's macros, however (which are a bit fragile and not absolutely obvious to use) are not described there. I seem to recall my original QPTR documentation had some description of the config macros, but more recent documents seem to lack that chapter.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
t0nyt
Gold Card
Posts: 370
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: Run a SuperBasic program from Assembler?

Post by t0nyt »

Have modified the program to use a config block for the path and am able to re-configure the path using level 1 config program from Dilwyn's download pages

Am sure the code could be done better (like sanity checking on the path configured)

Many thanks all

Code: Select all

         TITLE    Show Menu

         INCLUDE  'win2_dev_quanta_QDOS1_IN'
         INCLUDE  'win2_dev_quanta_MACRO_LIB'
         INCLUDE  'win2_dev_quanta_CONFIG_MAC'

BP.INIT  equ      $110
IO.QIN   equ      $E0

         SECTION CODE
start    lea      define,a1
         move.w   BP.INIT,a2
         jsr      (a2)
         rts

define   dc.w     1
         dc.w     MENU-*
         dc.b     4,'MENU '
         dc.w     0

         dc.w     0
         dc.w     0

MENU     lea      runcmd,a0         ; ptr to lrun text
         move.w   (a0)+,d2          ; byte count
         bsr.s    endLoop           ; skip loop

         lea      met_cmdpath,a0    ; ptr to configured path
         move.w   (a0)+,d2          ; byte count
         bsr.s    endLoop           ; skip loop

         lea      runcmd2,a0        ; prt to MENU text
         move.w   (a0)+,d2          ; byte count
         bsr.s    endloop           ; skip loop

         rts                        ; all done

nextchar move.b   (a0)+,d1          ; get character
         bsr.s    doqin             ; send to buffer

endLoop  dbra     d2,nextchar       ; loop if not done

         rts                        ; loop done

doqin    movem.l  a0/d1/d2,-(sp)
         QDOSMT$  MT.INF
         move.l   sv_keyq(a0),a2
         movem.l  (sp)+,a0/d1/d2
         VECTOR   IO.QIN,a4
         rts

runcmd   dc.w     cmdEND-runcmd-2
         dc.b     'lrun '
cmdEND   equ      *

runcmd2  dc.w     cmdEND2-runcmd2-2
         dc.b     'MENU',$0A
cmdEND2  equ      *

                  mkcfstr  cmdpath,40,{win1_wrk_}

configBlk         mkcfhead {MENU},{1.0}
                  mkcfitem string,'P',mxl_cmdpath,,,{Path to Menu File}
                  mkcfend
         END


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

Re: Run a SuperBasic program from Assembler?

Post by NormanDunbar »

tofro wrote: Mon Apr 01, 2024 4:39 pm Unfortunately, Wolfgang's documentation describes the raw binary format expected by config. Tony's macros, however (which are a bit fragile and not absolutely obvious to use) are not described there. I seem to recall my original QPTR documentation had some description of the config macros, but more recent documents seem to lack that chapter.
I've had a look through all my docs, and unfortunately, I seem to only have the latest versions. I did have Jochen's original printed QPTR manual, but I updated that to Wolfgang's PDF/odf version, and the Config chapter has been removed. I do have an image of the original QPTR floppy disc, but the docs were printed on that too -- nothing in electronic format.

Bummer!

EDIT: Section 3.2 has an example of using the macros. https://dilwyn.qlforum.co.uk/docs/manuals/Config.pdf

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.
Post Reply