QL / PASCAL

Anything QL Software or Programming Related.
User avatar
Chain-Q
Chuggy Microdrive
Posts: 62
Joined: Mon Nov 16, 2020 1:10 pm
Location: Berlin, DE, EU
Contact:

Re: QL / PASCAL

Post by Chain-Q »

@NormanDunbar:
OK, now also the do_rename() and the do_mkdir() patch by you should be included in SVN trunk, although I did a small refactor, and as I previously indicated, I factored out the inline asm snippets into separate asm wrapper functions.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL / PASCAL

Post by mk79 »

Cool, thanks for continuing to work on this!


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: QL / PASCAL

Post by NormanDunbar »

Chain-Q wrote:@NormanDunbar:
OK, now also the do_rename() and the do_mkdir() patch by you should be included in SVN trunk, although I did a small refactor, and as I previously indicated, I factored out the inline asm snippets into separate asm wrapper functions.
Ok, thanks. I'll svn update again, soon. ;)


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.
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QL / PASCAL

Post by mk79 »

Chain-Q wrote:@NormanDunbar:
OK, now also the do_rename() and the do_mkdir() patch by you should be included in SVN trunk, although I did a small refactor, and as I previously indicated, I factored out the inline asm snippets into separate asm wrapper functions.
Just a small comment, factoring out SMSQ calls is good in principle, but MKDIR is not one. It was added with so called "Level 2" device drivers, so it's a driver and not an OS feature and basically all drivers except Microdrives support it.


User avatar
Chain-Q
Chuggy Microdrive
Posts: 62
Joined: Mon Nov 16, 2020 1:10 pm
Location: Berlin, DE, EU
Contact:

Re: QL / PASCAL

Post by Chain-Q »

Well I believe you, but I was following the docs here, which doesn't list a QDOS naming for this call:

http://qdosmsq.dunbar-it.co.uk/doku.php ... ap_3:start

Sooo... Anything? :) FS_MKDIR maybe?

I have another question: how long a job name is allowed to be? For now all generated executables have the job name "FPC" hardwired. It would be cool to have this set to something more meaningful compile time. But I need to know what's the longest name allowed.


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

Re: QL / PASCAL

Post by pjw »

Chain-Q wrote:<>
I have another question: how long a job name is allowed to be? For now all generated executables have the job name "FPC" hardwired. It would be cool to have this set to something more meaningful compile time. But I need to know what's the longest name allowed.
Im sure Marcel will answer this more definitively, but AFAIK no fixed maximum length was ever documented before SMSQ/E. Even so, different parts of the system use different maximums: SBASIC uses 40 char, while executable Things use 48. The Turbo and Q-Liberator compilers set various, arbitrary, limits. The current SMSQ/E key file keys/qdos_sms states:

Code: Select all

sms.mxjn equ    $30             recommended job name allowance in job header
The length word comes in addition.
To me this seems a sensible figure, which I have come to rely on in a number of programs I have written - hence my interest in piping up on this question. ;)


Per
dont be happy. worry
- ?
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QL / PASCAL

Post by tofro »

pjw wrote:
Chain-Q wrote:<>

Code: Select all

sms.mxjn equ    $30             recommended job name allowance in job header
The length word comes in addition.
To me this seems a sensible figure, which I have come to rely on in a number of programs I have written - hence my interest in piping up on this question. ;)
I don't think there is a limit other than the job name is just a QDOS string that lives in the job's code space, and most people use short branches to reach across that string (which would mean something along the lines of ~120 characters). There might be limits of how many characters of that string are actually being displayed by the job tools.

A quick test in assembly reveals:

"JOBS" in TK2, for example, seems to happily display everything you throw at it, the job listing in QPAC2 seems to have a limit of 70 displayable characters (and simply cuts the name at that length), Sysmon displays whatever fits into its current button size.
long job.png
inJobs.png
Such long job names (and even longer ones) actually make a bit of sense when you want to include both the program name and the file you're currently working on - like QD does, for example


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QL / PASCAL

Post by pjw »

I dont argue with that, Tobias, I was just pointing out what I thought was a sensible figure that one could rely on. Its up to the individual programmer if he thinks he can make good use of other values, although he should not be surprised if other parts of the system wont cooperate: If you were to load your super-long named job as a Thing, the name would get truncated to $30 char. And, as you pointed out, displaying the list of jobs in QPAC Jobs would truncate them at 70. Other utilities might have different tolerances.
Im the last person to wish to curtail what a programmer can do, but without some guidelines we just end up with a mess.


Per
dont be happy. worry
- ?
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QL / PASCAL

Post by tofro »

I don't argue on that as well ;)

There is quite good reasoning behind long job names in some cases (like QD incorporating the full file name of the file edited in its name, or a linker incorporating its command line,.... ). Such stuff can actually add valuable information to a job display.

As long as tooling simply displays parts of the job name within its own limits, I'm perfectly fine with having the end sliced off (as long as the tooling doesn't fall flat on its face when it encounters something un-usually long). But ruling on an arbitrary length just for the sake of a rule is not a good idea either ;)
Last edited by tofro on Sun Apr 11, 2021 12:37 pm, edited 1 time in total.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QL / PASCAL

Post by pjw »

PS: Last year I sent a request to Wolfgang to expand the name allowance for SBASIC daughter jobs to 48 characters (the value chosen by TT for Things etc) but it seems to have got lost. The current 40 char limit is just a little too little to my mind, while 48 allows for the full 42 char file name and a short program name, like "QD win1_abc_def_hij_..." Id be glad to follow that up if we can agree on a suitable guideline figure..


Per
dont be happy. worry
- ?
Post Reply