GST ASSEMBLER

Anything QL Software or Programming Related.
tcat
Super Gold Card
Posts: 633
Joined: Fri Jan 18, 2013 5:27 pm
Location: Prague, Czech Republic

GST ASSEMBLER

Post by tcat »

Hi,

I am reading Colin Opie's manual on assembly progarmming, trying to make my first steps in it.

Colin referres to McGraw-Hill macro assembler, that I cannot find in the archive, so I use GST, that has slighlty different syntax, also does not support ORG directive.

I have downloaded GST_ASM and QED applications from Dilwyn's site.
I somehow modified Colin's first example as folows, I assembled the code to binary that I later load and execute from SuperBASIC, it appears to work.

Am I getting the gist of Basic ASM interraction correctly?
Many thanks
TCAT

DEMO_ASM
=======
; Demonstration assembly program
; Copies parameters passed from SuperBASIC
; Calls SD.RECOL procedure


demo: lea data(pc),a2 ; params start
move.b d2,0(a2) ; 2nd param from D2
move.b d3,1(a2) ; 3rd param from D3
move.b d4,2(a2) ; etc
move.b d5,3(a2)
move.b d6,4(a2)
move.b d7,5(a2)
move.w a0,d2 ; 8th param from A0
move.b d2,6(a2)
move.w a1,d2 ; 9th param from A1
move.b d2,7(a2)
move.l a2,a1 ; set params pointer
move.w #0,d3 ; Timeout=0
move.l d1,a0 ; Channel
move.b #$26,d0 ; SD.RECOL
trap #3 ; call QDOS
rts

data: dc.b 0
ds.b 20
end

DEMO_BAS
=======
100 REMark DEMO PROGRAM
110 :
120 REMark machine binary file
130 file$ = 'mdv2_demo_bin'
140 fl = FLEN(\file$)
150 :
160 REMark reserve space in memory
170 REMark load machine binary code
180 :
190 mc = RESPR(fl)
200 LBYTES file$, mc
210 :
220 display_circles
230 PAUSE 50
240 REMark call machine code
250 CALL mc,65537,7,6,5,4,3,2,1,0
260 PAUSE 50
270 REMark call machine code
280 CALL mc,65537,0,1,2,3,4,5,6,7
290 GO TO 230
300 :
310 DEFine PROCedure display_circles
320 INK 0: FILL 1: CIRCLE 30,60,15
330 INK 4: FILL 0: CIRCLE 60,60,15
340 INK 6: FILL 1: CIRCLE 45,30,15
350 FILL 0
360 END DEFine


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

Re: GST ASSEMBLER

Post by tofro »

Hi!
tcat wrote: Colin referres to McGraw-Hill macro assembler, that I cannot find in the archive, so I use GST, that has slighlty different syntax, also does not support ORG directive.
That is, because ORG on the QL is generally not a good idea - Nearly everything in QDOS and derivates is designed to be position-independant. Just forget ORG, you will most probably not be missing it for a very long time ;)

And, BTW, the GST Macro Assembler is by far the most sophisticated assembler for the QL (apart from George's GWass that will, however, only run on 68020+.)
tcat wrote: I somehow modified Colin's first example as folows, I assembled the code to binary that I later load and execute from SuperBASIC, it appears to work.
If it works, then it's all right, I'd say. I couldn't say that for my first encounters with 68k assembler many, many years ago ;)
tcat wrote: Am I getting the gist of Basic ASM interraction correctly?
Well you seem to have explored one of the many, many ways of Basic/Assembler interaction the QL supports. Next steps would be writing SuperBASIC extensions, and from there a vast area to explore spreads out.

Once you've done that, explore the even wider field of assembler without SuperBASIC!

Go ahead and have more fun!

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: GST ASSEMBLER

Post by dilwyn »

Tomas Kral has emailed me about some missing files from the GST Assembler archive on the Assembler page of my website www.dilwyn.me.uk/asm/index.html (scroll down to GST-ASM). He says the three files boot, ed and info_text are missing.

Can anyone help me to provide the missing files?

GST QL software has been made freeware so no copyright issues with this.


RWAP
RWAP Master
Posts: 2837
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: GST ASSEMBLER

Post by RWAP »

I have sent you copies of the original GST Assembler and the Macro Assembler (including microdrive, disk and Quanta versions!)


User avatar
vanpeebles
Commissario Pebbli
Posts: 2821
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: GST ASSEMBLER

Post by vanpeebles »

Sounds like tcat has assembled quite a collection! :mrgreen:


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

Re: GST ASSEMBLER

Post by tofro »

All,

please be aware that the original GST Macro Assembler, Assembler, and C compiler are now Public Domain, while the Quanta Version of the Macro Assembler, to my knowledge, is not.

Maybe someone closer to Quanta than I am can verify that.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: GST ASSEMBLER

Post by dilwyn »

tofro wrote:All,

please be aware that the original GST Macro Assembler, Assembler, and C compiler are now Public Domain, while the Quanta Version of the Macro Assembler, to my knowledge, is not.

Maybe someone closer to Quanta than I am can verify that.

Tobias
Until fairly recently it was available to members only. Then the committee took the decision to make it available (IIRC as freeware) once GST gave permission for the GST QL software to become freeware.

Anyway, Rich Mellor has kindly supplied copies of the various GST assembler packages, I just need to split up the packages and (since Rich uses QemuLator) if they need "de-QemuLatoring" to work on other systems. I'm on the case...


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

Re: GST ASSEMBLER

Post by dilwyn »

dilwyn wrote: Anyway, Rich Mellor has kindly supplied copies of the various GST assembler packages, I just need to split up the packages and (since Rich uses QemuLator) if they need "de-QemuLatoring" to work on other systems. I'm on the case...
Ah, yes they do. Rich has zipped up the Windows folders containing the QemuLator files, which have the QemuLator modified nfa files, so I can't unzip them using normal QL Unzip as the paths are too long (hopefully QemuLator will do that by attaching the archives as drives), and they won't execute on other systems. Then I need to figure out how to remove the QemuLator mods to the files (probably just copy all the files to non-NFA drives like ramdisk or floppy), re-zip them to shorten paths and make sure no QemuLator headers creep back in....might take longer than I thought.

Even after 30 years I learn something new QL every day! Mr Navigator, would this make a helpline column for the mag, or is too specialist do you think? Would also be useful to know if the same process is needed on Mac QemuLator.


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

Re: GST ASSEMBLER

Post by dilwyn »

With much appreciated help from Rich Mellor, the GST QL Assembler, Macro Assembler and Quanta Q-Mac are now available to download from my website at http://www.dilwyn.me.uk/asm/index.html

The Macro Assembler is available as a floppy disk version, or a two microdrive cartridge (program and library cartridges) version.

Thomas Kral will be glad to know the editor is included now.

Manuals are also available to download as PDF files. Note that the manual for the QL Assembler is rather large by QL standards at about 10MB.

Urs Koenig got permission from GST’s founder to release GST’s QL software as freeware a little while back, and Quanta committee decided after that to allow the Q-Mac (Quanta modified version of the Macro Assembler) to be made available for all QL users (previously only available to members).

I have to explain that these packages were prepared in rather a hurry tonight as I have to get up early for work tomorrow, so I haven’t had time to test them, especially as I am not familiar with these programs, so if anyone finds problems, please let me know (e.g. missing files).


User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: GST ASSEMBLER

Post by Mr_Navigator »

[quote="tcat"]
And, BTW, the GST Macro Assembler is by far the most sophisticated assembler for the QL (apart from George's GWass that will, however, only run on 68020+.)
[quote="tcat"]

OMG, having a senile moment, I have read many posts, articles, videos and spoken to George personally several times, I have only just realised what GWass stands for.....DOH! :o :oops:


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
Post Reply