What Editor is best to use ?

Helpful tips and guides, also new users can ask for help here.
User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: What Editor is best to use ?

Post by mk79 »

Oh, right, I didn't remember that QD could be LRESPRed. Funnily enough this is the exact same bug that I diagnosed only a week ago in another tool and even wrote a blog post about: https://www.kilgus.net/2018/08/08/qdos- ... pr-or-not/.
The mechanism to distinguish between EX and LRESPR basically relied on undefined behaviour which works everywhere by chance except on QemuLator (in depth: the IOF.LOAD trap specification says D1 is undefined on return. Basically all QL drivers return something in there, just QemuLator returns 0. But 0 is perfectly valid, so QemuLator is not to blame here).

I have uploaded a new version B.03 that fixes this problem, just re-download the ZIP.

Cheers, Marcel


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

Re: What Editor is best to use ?

Post by Derek_Stewart »

Hi Marcel,

QD is the best editor for the QL... It is probably the last software I have bought,

I usually HOT_LOAD QD from a hotkey or a Button.


Regards,

Derek
User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: What Editor is best to use ?

Post by janbredenbeek »

mk79 wrote:Oh, right, I didn't remember that QD could be LRESPRed. Funnily enough this is the exact same bug that I diagnosed only a week ago in another tool and even wrote a blog post about: https://www.kilgus.net/2018/08/08/qdos- ... pr-or-not/.
I used to test D1 from SMS.INFO (see Multimon source) but in these days of MultiBASICs that's no longer enough ;) .
But I'm curious if comparing A6 to the start of the job code will guarantee that your code is executing as a job. This might be true when you EXEC or HOT_LOAD a program (since this allocates space for both code and data and then loads and executes the code) but what about HOT_RES, which only allocates space for the data (apart from a small job header)? Then A6 will point to the start of the small job header, which contains a JMP into the code loaded earlier by HOT_RES. So the comparison will fail and the code continues into the SMS.INFO call which will return a nonzero D1, and the code ends with err.nimp and RTS (which probably causes a crash since there's no valid return address on the stack).

Anyone already tried this?

Jan.


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

Re: What Editor is best to use ?

Post by mk79 »

janbredenbeek wrote:But I'm curious if comparing A6 to the start of the job code will guarantee that your code is executing as a job. This might be true when you EXEC or HOT_LOAD a program (since this allocates space for both code and data and then loads and executes the code) but what about HOT_RES, which only allocates space for the data (apart from a small job header)?
God damn it, you are right. I have updated both QD and my blog post with a new method I came up ;)

Thanks! Cheers, Marcel


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: What Editor is best to use ?

Post by janbredenbeek »

mk79 wrote:
janbredenbeek wrote:But I'm curious if comparing A6 to the start of the job code will guarantee that your code is executing as a job. This might be true when you EXEC or HOT_LOAD a program (since this allocates space for both code and data and then loads and executes the code) but what about HOT_RES, which only allocates space for the data (apart from a small job header)?
God damn it, you are right. I have updated both QD and my blog post with a new method I came up ;)
Very clever new test ;) . It is very unlikely that bit 6 of (A6) will ever become set under S*BASIC even if you have 1GB of RAM, because it's the relative pointer of the start of SB's buffer which starts right after the system variables (hence you would need 1GB of SB's system variables for it to become set :D ). Be sure that the first instruction is BRA or JMP though...
The test for $4AFB at 6(A6) would only fail if SB's buffer reaches 18939 (19195-256) bytes in size which is again unlikely (but perhaps a bit more likely than SB's system variables reaching 1GB...).

Jan.


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

What Editor is best to use ?

Post by mk79 »

janbredenbeek wrote:Very clever new test Image . It is very unlikely that bit 6 of (A6) will ever become set under S*BASIC even if you have 1GB of RAM, because it's the relative pointer of the start of SB's buffer which starts right after the system variables (hence you would need 1GB of SB's system variables for it to become set Image ).
In SBASIC the buffer is allocated from the common heap when it is resized and as A6 is low the relative pointer can get huge very quickly (yes, I did actually try it ;))
The test for $4AFB at 6(A6) would only fail if SB's buffer reaches 18939 (19195-256) bytes in size which is again unlikely (but perhaps a bit more likely than SB's system variables reaching 1GB...).
I did consider relying on this until I’ve seen that the bottom 16 bits can be pretty much arbitrary due to the buffer moving freely in memory. Still very unlikely, but too likely for my stomach Image

Marcel


User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Post by Andrew »

Hi Marcel

now when I load QD2018 (latest version, start from flp1_, using boot_english renamed as boot) Qemulator does not hangs, but I need to press Ctrl-C to get a prompt - and at second Ctrl-C QD shows up with with no icons!
Image

If I execute again EXEP QD - then it shows ok, with all icons
If I boot without LRESPR QD_english and then start it with EXEC QD - it starts ok, with all icons


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

Re: What Editor is best to use ?

Post by mk79 »

Andrew wrote:now when I load QD2018 (latest version, start from flp1_, using boot_english renamed as boot) Qemulator does not hangs, but I need to press Ctrl-C to get a prompt
OK, strange. This looks more like a problem with the pointer environment (the red X is used when a sprite is not available in the current colour mode), but I'm afraid I cannot reproduce it here, not with Minerva or JS rom. What version does it show when you right click on the help icon?

Cheers, Marcel


User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: What Editor is best to use ?

Post by Andrew »

mk79 wrote:OK, strange. This looks more like a problem with the pointer environment (the red X is used when a sprite is not available in the current colour mode), but I'm afraid I cannot reproduce it here, not with Minerva or JS rom. What version does it show when you right click on the help icon?

Cheers, Marcel
version B.04

Later edit: you are right, Marcel - it is a color mode problem.
The fix is to add line :

Code: Select all

5 Mode 4
in the boot file

When Qemulator starts in TV mode it starts in mode 8


User avatar
M68008
Trump Card
Posts: 223
Joined: Sat Jan 29, 2011 1:55 am
Contact:

Re: What Editor is best to use ?

Post by M68008 »

Andrew wrote:When Qemulator starts in TV mode it starts in mode 8
That's what every QL does.


Btw, you may already have found this, but just in case: adding

Code: Select all

LRESPR macmouse11
just after loading PTR_GEN allows using the PC mouse. (MacMouse11 can be found in the Q-emuLator\QL Software directory).


Post Reply