Page 3 of 4

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

Posted: Fri Aug 14, 2020 2:06 am
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).

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

Posted: Fri Aug 14, 2020 6:37 am
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.

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

Posted: Fri Aug 14, 2020 9:12 am
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.

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

Posted: Sun Aug 16, 2020 3:28 am
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)

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

Posted: Sun Aug 16, 2020 8:33 am
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.

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

Posted: Tue Aug 18, 2020 6:59 am
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.

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

Posted: Tue Aug 18, 2020 7:29 am
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

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

Posted: Tue Aug 18, 2020 7:46 am
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.

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

Posted: Tue Aug 18, 2020 8:09 am
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.

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

Posted: Tue Aug 18, 2020 8:23 am
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 ;-)