My QL Assembly Language eBook. Originally serialised over numerous years in QL Today magazine. https://github.com/NormanDunbar/QLAssem ... tober-2020. It's been updated since the demise of said magazine and rejigged as an eBook.
Somewhere in amongst all that lot there should be details on how a QDOS/SMSQ job is set up and the registers involved and what they are used for,
HTH
And apologies if "granny already knows how to suck eggs"!
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
My QL Assembly Language eBook. Originally serialised over numerous years in QL Today magazine. https://github.com/NormanDunbar/QLAssem ... tober-2020. It's been updated since the demise of said magazine and rejigged as an eBook.
Somewhere in amongst all that lot there should be details on how a QDOS/SMSQ job is set up and the registers involved and what they are used for,
HTH
And apologies if "granny already knows how to suck eggs"!
Cheers,
Norm.
Thanks Norm. I already have your eBook but will take a look at the Magazines too
As a quick and dirty test I put code in the timerTick routine to change the screen mode
As hoped the screen mode continually get's reset, which to my mind means the routine is being called as it should
My problem now is that I replaced that code with a line to add 1 to a counter location (which I initialised previously to 0) but whatever I try I can't use that counter in the main program loop to block for a time. It's like it's not incrementing.
The journey continues I guess
Could anyone confirm how many times a second the timerTick routine should be getting called please?
t0nyt wrote: Fri Feb 23, 2024 4:17 pm
As a quick and dirty test I put code in the timerTick routine to change the screen mode
As hoped the screen mode continually get's reset, which to my mind means the routine is being called as it should
My problem now is that I replaced that code with a line to add 1 to a counter location (which I initialised previously to 0) but whatever I try I can't use that counter in the main program loop to block for a time. It's like it's not incrementing.
The journey continues I guess
Could anyone confirm how many times a second the timerTick routine should be getting called please?
Many thanks
Have managed to sort it now, thanks (and looks like it triggers about 50 times a second, 50hz?)
Many thanks for all the advise and patience everyone
tofro wrote: Thu Feb 22, 2024 5:26 pm
Don't use OFFSET.
Here's what I do:
All of my program code goes into a SECTION code
All of my data goes into a SECTION DATA
If you start a new section, the assembler re-sets all the addresses it generates to 0.
By setting a6 to the data space base adress at the beginning of the program and indexing by the labels in the data section, the assembler will manage the proper addresses:
SECTION code
lea.l 0(a6,a4),a6 ; let a6 point to the bottom of the data space
move.l #100,a(a6) ; moves 100 to a6+a
move.l #200,b(a6) ; same for b
move.w #100-1,d0
loop:
clr.b buffer(a6,d0.w) ; clear the buffer
dbra d0,loop
Thus, you don't really care where your variables are - they are always relative to a6, and where a6 points to was allocated by QDOS. You simply use the names.
If you write your code in multiple source files, the code that defines what's going on in your data space typically goes into an include file, that is INCLUDEd in all your code files.
Hi Tofro,
I'm really struggling with getting this to work
I copied your code into a new asm file and no matter what options I choose it fails to compile with "relocatable value not allowed here" related to anything referencing A6 like "a(a6)" and "b(a6)" etc.
Any thoughts on why this is happening please? Am sure I'm doing something wrong, but don't understand what
The QL's RTC is only progressing in 1s intervals. You could use it, but it would make your program crawl The polling interrupt is really the only way you get a suitably fast tick rate.
If you pack your sources and put them here I could have a look at it.