A noob's guide to QL machine code

Anything QL Software or Programming Related.
User avatar
NormanDunbar
Forum Moderator
Posts: 2436
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: A noob's guide to QL machine code

Post by NormanDunbar »

I have a somewhat irregular Assembly Language eMagazine over at:

https://github.com/NormanDunbar/QLAssem ... e/releases

where there are 11 or 12 issues ready to download for free.

The later issues include a Beginners' Corner where there are always details of how to assemble the code with QMAC and GWASS.

If executing GWASL gives you errors, I suspect you might have uncompressed it on a PC rather than in QDOS/SMSQ?


HTH

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.
Derek_Stewart
Font of All Knowledge
Posts: 4634
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: A noob's guide to QL machine code

Post by Derek_Stewart »

Hi

Reading the QMAC assembler manual, section B 5.3 page 40, allows the use of ADD<length> <ea> <ea>

If <length> omitted .w assumed

How does rmac handle QDOS executable headers?

Note: rmac being an Atari assembler.


Regards,

Derek
spkr
Brittle Membrane
Posts: 110
Joined: Tue May 04, 2021 6:52 pm

Re: A noob's guide to QL machine code

Post by spkr »

Just assemble to binary and load the binary. The assembler has no need to care about headers per se.


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

Re: A noob's guide to QL machine code

Post by Derek_Stewart »

spkr wrote: Sun Dec 29, 2024 4:33 pm Just assemble to binary and load the binary. The assembler has no need to care about headers per se.
what filetype does the assembler produce?


Regards,

Derek
spkr
Brittle Membrane
Posts: 110
Joined: Tue May 04, 2021 6:52 pm

Re: A noob's guide to QL machine code

Post by spkr »

Binary m68k.


User avatar
pjw
QL Wafer Drive
Posts: 1601
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: A noob's guide to QL machine code

Post by pjw »

@TMD2003, if you want to learn about assembler coding for QL systems from someone who knows, stick with Norm's ezine.


Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Derek_Stewart
Font of All Knowledge
Posts: 4634
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: A noob's guide to QL machine code

Post by Derek_Stewart »

This topic also dicussed on the QL Discord channel.

It seems that adding an XTcc trailer at the end of the ctoss compliled program, and a QL emulator or QLTools will restore the executable header.

Is the XTcc trailer data the best way to restore executable header in QDOS/SMSQ/E?


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1596
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: A noob's guide to QL machine code

Post by XorA »

As the last thing in your asm program.

Code: Select all

trailer:
    dc.b 'X','T','c','c', 0, 0, 0, 0
Or set an actual dataspace if you need it!

qlzip, qltools, mdvtool (I think), sQLux, Q-Emulator, QPC2 all support that to recreate the exe info inside QDOS.


User avatar
Peter
Font of All Knowledge
Posts: 2404
Joined: Sat Jan 22, 2011 8:47 am

Re: A noob's guide to QL machine code

Post by Peter »

Derek_Stewart wrote: Mon Dec 30, 2024 6:43 pm Is the XTcc trailer data the best way to restore executable header in QDOS/SMSQ/E?
In my opinion, yes it is. Extra data at the end of an executable hurts much less than at the beginning.


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

Re: A noob's guide to QL machine code

Post by tofro »

Peter wrote: Mon Dec 30, 2024 7:19 pm
Derek_Stewart wrote: Mon Dec 30, 2024 6:43 pm Is the XTcc trailer data the best way to restore executable header in QDOS/SMSQ/E?
In my opinion, yes it is. Extra data at the end of an executable hurts much less than at the beginning.
Well, the best method is not to loose them headers at all in the first place. I think every halfway decent QL user should be aware that unzipping on everything else but a QDOSSMSQ system is a big no-no. In my opinion, any method to make them forget this awareness is somewhat counter-productive and not much more than a kludge.

But XTcc is at least a method to potentially fix such accidents.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Post Reply