Page 2 of 2
Re: Assembler Programming Problem
Posted: Thu Sep 18, 2025 7:44 am
by t0nyt
Will take a look, thanks Norm
What I was doing was calling GTSTR, check for $0101 on the name table
If there was a match then I would use the string
If it wasn’t a match I’d then call GTINT but that didn’t return the 1 or 2 integers, but debugging showed the ascii version of the 1st integer value on the stack
In isolation both of my GTSTR and GTINT routines work fine, but not one after the other
Re: Assembler Programming Problem
Posted: Thu Sep 18, 2025 9:37 am
by t0nyt
When I debug, the parameter(s) don't appear on the name table A6,A3.l until after GTSTR or GTINT are called
So that rules out checking the parameter type BEFORE making a GTSTR/GTINT call
And once I make a GTSTR call, and there's not a string parameter, the call to GTINT doesn't work to get the numeric parameter(s), but it does work if GTSTR isn't called first
Re: Assembler Programming Problem
Posted: Thu Sep 18, 2025 10:00 am
by t0nyt
After doing just GTSTRG, but with 2 numeric parameters (in this case 16,1), the name table shows first entry as a numeric on the RI stack and the 2nd parameter as type $0203 so not on RI stack
When I look at the RI stack the number 16 is actually a string (2 bytes of length & ascii characters for "16")
|'m assuming that's why I can't get the first parameter then with GTINT, because it's already been processed?
EDIT: I also tried calling GTINT first, but that doesn’t work either (breaks reading the text)
Many thanks
Tony
Re: Assembler Programming Problem
Posted: Thu Sep 18, 2025 3:48 pm
by t0nyt
NormanDunbar wrote: Thu Sep 18, 2025 5:41 am
t0nyt wrote: Wed Sep 17, 2025 5:46 pm
It seems if you try and read a string parameter before then trying to read numeric value(s) the first number gets read as a string
Really? I'm surprised!
You might find section 7.5.2, table 7.7 and section 7.6 in the 2020 edition of my book useful. You can determine each parameter type from 1(a6,a3.l) - bits 0--3 determine the type of each parameter. You
should be able to fetch them one by one if necessary.
I've never written a procedure which can take different parameter types on different calls, so I might be wrong. Worth an experiment maybe?
HTH
Cheers,
Norm.
Hi Norm,
I was looking at page 79, because I'm working out how to use bv_chrix for my buffer, and you put 2 into D1 when calling it, but shouldn't this be D0 please?
EDIT: I'm confused. searches on here say D1, but the QL Technical Guide's I have say D0
Many thanks
Tony
Re: Assembler Programming Problem
Posted: Thu Sep 18, 2025 9:54 pm
by NormanDunbar
Hi Tony,
From Wolfgangs current docs for SMSQ and QDOS:
Space may be allocated on the stack by calling the vectored routine QA.RESRI: the number of bytes required is given in D1.L; D0 to D3 are smashed by the call. Since both the stack within the S*Basic area and the S*Basic area itself may move during a call, the stack pointer should be saved in BV_RIP(A6) before the call, and restored from BV_RIP(A6) after the call has been completed. The routine ensures that the restored value will be correct.
QA.RESRI is the same as BV_CHRIX. So D1.L is where the space you require is put prior to calling the vector to do the allocation.
HTH.
Cheers,
Norm.
Re: Assembler Programming Problem
Posted: Fri Sep 19, 2025 7:35 am
by t0nyt
Thanks Norm, D1 it is then!
Many thanks
Tony
Re: Assembler Programming Problem
Posted: Fri Sep 19, 2025 12:49 pm
by tofro
In a BASIC Extensionion you should also be able to safely use the BASIC buffer.