Assembly eMagazine - What do you want to read about?

Anything QL Software or Programming Related.
martyn_hill
QL Wafer Drive
Posts: 1062
Joined: Sat Oct 25, 2014 9:53 am

Re: Assembly eMagazine - What do you want to read about?

Post by martyn_hill »

tofro wrote: Fri Jan 24, 2025 9:00 pm That doesn't happen. Ever. :)
Oh, no, not ever :-) Probably a bad/controversial example, that one!

I realise now that I didn't articulate the scenario itself very well and perhaps its a moot point, but when we know the absolute address we want to load into an A reg, wouldn't the two forms (LEA <label> and MOVEA #<immediate_add>) achieve the same result, assuming <label> falls at <immediate_add> and exists in our code block?

If so, I guess the decision to use one or the other would then depend on whether we are writing for relocatable code or to a known, specific address (rare, on the QL)...


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

Re: Assembly eMagazine - What do you want to read about?

Post by tofro »

martyn_hill wrote: Fri Jan 24, 2025 9:22 pm
tofro wrote: Fri Jan 24, 2025 9:00 pm That doesn't happen. Ever. :)
Oh, no, not ever :-) Probably a bad/controversial example, that one!

I realise now that I didn't articulate the scenario itself very well and perhaps its a moot point, but when we know the absolute address we want to load into an A reg, wouldn't the two forms (LEA <label> and MOVEA #<immediate_add>) achieve the same result, assuming <label> falls at <immediate_add> and exists in our code block?

If so, I guess the decision to use one or the other would then depend on whether we are writing for relocatable code or to a known, specific address (rare, on the QL)...
If you specify the value of the label with an EQU, the value will be absolute (and your two example instructions will do exactly the same thing). If you reference to data defined in your own program (to a label in front of a dc.l, for example), the assembler will assume you want a PC-relative address (and the move.l #label will not work without a warning).

A better example where absolute addressing is really necessary and acceptable would maybe be the QL hardware registers at $18000+ (like MC_STAT or PC_INTR), because QDOS doesn't have an easy way to tell you where they are, and you might be able to verify your program runs on a black box QL before (and you'll likely be doing dirty things anyhow...).


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Martin_Head
Aurora
Posts: 964
Joined: Tue Dec 17, 2013 1:17 pm

Re: Assembly eMagazine - What do you want to read about?

Post by Martin_Head »

martyn_hill wrote: Fri Jan 24, 2025 5:36 pm Hi Norm!

A topic I still to this day struggle-with is the concept of 'SECTION's, relocatable directives, when I can and can't use DS blocks, LINKing and related features of QMAC and similar assemblers.
I would second that, I've recently just tried writing a machine code program in separate parts and linking them together with the QMAC linker for the first time. And I had a lot of trouble trying to understand what I had to do, how to write the LINK file, and drive the linker. Also some help on how to use QMAKE. Which I still haven’t got to work yet.


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

Re: Assembly eMagazine - What do you want to read about?

Post by Derek_Stewart »

Hi,

I thought that QMAKE used the same link files as the QMAC assembler and was compatible with Tony Tebby Linker.


Regards,

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

Re: Assembly eMagazine - What do you want to read about?

Post by tofro »

Derek_Stewart wrote: Sat Jan 25, 2025 6:19 pm Hi,

I thought that QMAKE used the same link files as the QMAC assembler and was compatible with Tony Tebby Linker.
Yes it does. But you still need to know how to write the linker control file. :)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Derek_Stewart
Font of All Knowledge
Posts: 4652
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Assembly eMagazine - What do you want to read about?

Post by Derek_Stewart »

I have also processed:
Assembly Language Programming on the Sinclair QL programming the 68008 micprocessor, by Andrew Pennell

viewtopic.php?p=48231#p48231


Regards,

Derek
User avatar
NormanDunbar
Forum Moderator
Posts: 2456
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: Assembly eMagazine - What do you want to read about?

Post by NormanDunbar »

Derek_Stewart wrote: Sat Jan 25, 2025 6:31 pm I have also processed:
Assembly Language Programming on the Sinclair QL programming the 68008 micprocessor, by Andrew Pennell

viewtopic.php?p=48231#p48231
Indeed you have Derek, an excellent recommendation, thanks.

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