Newbie: Where to start to learn QL assembly language?

Anything QL Software or Programming Related.
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Newbie: Where to start to learn QL assembly language?

Post by ql_freak »

tofro wrote:GWASL: http://www.dilwyn.me.uk/asm/gwaslp08.zip
The "light" version of the GWASS assembler that runs on 68000 (GWASS needs a 68020 processor)
I dunno GWASL, what syntax does it use? The one from the AS68 assembler or the traditional as (e.g.) the GST Macro Assembler?
tofro wrote:GST Macro Assembler Suite: http://www.dilwyn.me.uk/asm/gst/gstmacroquanta.zip
THIS IS (until now) MY FAVOURITE ASSEMBLER!

Another good assembler (I have never used it, but Boris Jakubith, author of the first history device, BTool, ...) has used it, as its standard assembler:

HiSoft Assembler (I think, that was the name).

DO NOT USE THE METACOMCO ASSEMBLER! It can IMHO not even create position independent code (was my first assembler - had nothing better).


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
M68008
Trump Card
Posts: 224
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: Newbie: Where to start to learn QL assembly language?

Post by M68008 »

ql_freak wrote:DO NOT USE THE METACOMCO ASSEMBLER! It can IMHO not even create position independent code (was my first assembler - had nothing better).
I use the Metacomco assembler, no problems here in creating position-independent code and QL executables.


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

Re: Newbie: Where to start to learn QL assembly language?

Post by tofro »

ql_freak wrote:
tofro wrote:GWASL: http://www.dilwyn.me.uk/asm/gwaslp08.zip
The "light" version of the GWASS assembler that runs on 68000 (GWASS needs a 68020 processor)
I dunno GWASL, what syntax does it use? The one from the AS68 assembler or the traditional as (e.g.) the GST Macro Assembler?
It uses Motorola notation, as every sane 68k assembler should. (i.e. the same as GST)

Its Macro syntax is slightly different from GST's, but with largely the same features (although I think GST's Macro language still has a bit more funky features).

The Metacomco Assembler is in fact not that bad - It used to be a reliable piece of code in its time supporting all the needed features (It can very well produce PIC). I do, however, not see a point in using it, as it has so long not been maintained and doesn't even support default directories. GST and GWASL are much newer, do the same thing - just better, and support modern QDOSMSQ features.

Another argument for GST is that most tooling that produces assembly code (like QPTR tools and EasyPtr) produce code for this assembler.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Newbie: Where to start to learn QL assembly language?

Post by ql_freak »

tofro wrote:(although I think GST's Macro language still has a bit more funky features).
YEAH! I love it, especially the syntactical sugar macro GOTO

(It's really not needed! Really just syntactical sugar)

p.s.: Thanks for info about GWAS(S/L)


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Newbie: Where to start to learn QL assembly language?

Post by tofro »

ql_freak wrote:
tofro wrote:(although I think GST's Macro language still has a bit more funky features).
YEAH! I love it, especially the syntactical sugar macro GOTO

(It's really not needed! Really just syntactical sugar)

p.s.: Thanks for info about GWAS(S/L)
Well, GOTO is a bit more than syntactical sugar. I've used it a few times in the past for repeat macros that generate lots of code. Much better than writing all this stuff by hand.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Newbie: Where to start to learn QL assembly language?

Post by ql_freak »

tofro wrote:Well, GOTO is a bit more than syntactical sugar. I've used it a few times in the past for repeat macros that generate lots of code. Much better than writing all this stuff by hand.
NOPE! It's pure syntactic sugar! Without GOTO you can of course use e.g. the IFNUM macro:

IFNUM 0=0 GOTO label
;-)

As the expression 0=0 is evaluated at assemble time, there is not any penalty for the generated code.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Newbie: Where to start to learn QL assembly language?

Post by tofro »

ql_freak wrote:
tofro wrote:Well, GOTO is a bit more than syntactical sugar. I've used it a few times in the past for repeat macros that generate lots of code. Much better than writing all this stuff by hand.
NOPE! It's pure syntactic sugar! Without GOTO you can of course use e.g. the IFNUM macro:

IFNUM 0=0 GOTO label
;-)

As the expression 0=0 is evaluated at assemble time, there is not any penalty for the generated code.
I recommend you take a look at issue 7 of Norman's assembly language eComic where I have supplied an article on Q68 speed optimizations. There's a macro in there that uses GOTO that would have been nearly impossible to write without GOTO.

(Beyond that, I really recommend anyone to read the whole series - it's superb - except the parts I contributed, of course :) )

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Newbie: Where to start to learn QL assembly language?

Post by ql_freak »

tofro wrote:There's a macro in there that uses GOTO that would have been nearly impossible to write without GOTO.
As I have noted in my previous message, without the GOTO macro you can use e.g. the IFNUM macro (WHICH INCLUDES A goto! The GOTO macro is a macro of it's own, the "GOTO" in the IFNUM macro IS NOT the GOTO macro), so the GOTO macro is really just syntactic sugar. This is also stated in the original GST Macro Assembler manual – this is where I have understood, what syntactic sugar means.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Newbie: Where to start to learn QL assembly language?

Post by tofro »

ql_freak wrote:
tofro wrote:There's a macro in there that uses GOTO that would have been nearly impossible to write without GOTO.
As I have noted in my previous message, without the GOTO macro you can use e.g. the IFNUM macro, so the GOTO macro is really just syntactic sugar. This is also stated in the original GST Macro Assembler manual – this is where I have understood, what syntactic sugar means.
What the manual says is the unconditional GOTO

Code: Select all

 GOTO maclabel

is syntactic sugar over the conditional GOTO

Code: Select all

 IFNUM [a]<[b] GOTO maclabel
because the unconditional one could always be replaced with a conditional one where the condition is always true like

Code: Select all

 IFNUM 0=0 GOTO maclabel
(which is a bit in the wierd end to write) - they're not saying GOTO in general is syntactic sugar.

On second thought: Seen like that, isn't somehow all of a macro language "syntactic sugar"? There's no program you couldn't write without it with just more typing - As such, I find that statement in the manual quite a bit odd.... But it's still a very useful thing and I use it a lot in my programs.
Last edited by tofro on Tue Aug 18, 2020 8:24 am, edited 1 time in total.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
ql_freak
Gold Card
Posts: 354
Joined: Sun Jan 18, 2015 1:29 am

Re: Newbie: Where to start to learn QL assembly language?

Post by ql_freak »

Indeed an assembler is already syntactic sugar, you can put the binary data via hardware switches into a computer. In fact I have a book for building a Z80 computer, where you must do this, to set it up ;-)


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply