Q_Liberator malaise

Anything QL Software or Programming Related.
User avatar
Artificer
Trump Card
Posts: 166
Joined: Fri Nov 24, 2017 8:43 am

Re: Q_Liberator malaise

Post by Artificer »

pjw wrote:
Q_ERR_xxx figures largely in the Qlib compiler itself..
True, and QLib unmodified does not run on the Q60 with copyback enabled, at the moment it needs Wolfgang Lenerz's patch programs.

Cheers


User avatar
RalfR
QL Wafer Drive
Posts: 1212
Joined: Fri Jun 15, 2018 8:58 pm

Re: Q_Liberator malaise

Post by RalfR »

Aha, so the whole problem could also be related to the handling of Q_ERR_xx?

That reminds me of a tool by Steve Jones that was included on the "Sidewinder de Luxe" disk. It allowed you to generate a function from any MC procedure(!) and then have a new keyword.


7000 4E75
Martin_Head
Aurora
Posts: 985
Joined: Tue Dec 17, 2013 1:17 pm

Re: Q_Liberator malaise

Post by Martin_Head »

Mark Swift wrote: Sat Jul 12, 2025 1:01 pm Hi,

It's likely that the data cache will need to be flushed out to memory after this routine; before it can be executed as code.

Code: Select all

; Make 28 copies of this code in allocated buffer
L014E   clr.l   (a0)+
        move.l  #$207AFFFA,(a0)+     ;movea.l  $01FFFC(pc),a0
        move.l  #$4E903D40,(a0)+     ;jsr  (a0)
        move.l  #$00C27000,(a0)+     ;move.w  d0,lv_qerno(a6)
        move.w  #$4E75,(a0)+         ;moveq  #$00,d0
                                     ;rts
        dbf     d1,L014E             ;loop
Thanks
Is there a system trap, or vector to do this.
Or is it a processor instruction

And is it 68060/Q60 specific. If so, how could I test for a Q60.


User avatar
Mark Swift
Bent Pin Expansion Port
Posts: 90
Joined: Fri Jul 18, 2014 9:13 am
Location: Blackpool, Lancs, UK
Contact:

Re: Q_Liberator malaise

Post by Mark Swift »

Hi Martin,
Martin_Head wrote: Sun Jul 13, 2025 1:03 pm Is there a system trap, or vector to do this.
I may be wrong, but I don't believe that there is a system trap.
Martin_Head wrote: Sun Jul 13, 2025 1:03 pm And is it 68060/Q60 specific. If so, how could I test for a Q60.
Copyback is only available on 68040+. Offset 161 in the system variables should hold the processor type (68040=$40).

This code should work if called from supervisor mode, with a6 pointing to the system variables.

Code: Select all

        cmpi.b  #$40,$A1(a6)
        bls.s   NOPUSH               skip if 040 or less

        dc.w    $4E7A,$0002          movec cacr,d0
        tst.w   d0                   check 040 bits
        bpl.s   NOPUSH               branch if data cache off

        dc.w    $F478                cpusha dc ; update memory from cache
NOPUSH:
BTW; another possible problematic bit of code is this.

Code: Select all

        move.w  sr,d6                ;save the status register
        trap    #$00                 ;enter supervisor mode
        adda.l  a6,a1                ;make A1 absolute
        moveq   #$00,d2
        move.b  (a1)+,d2             ;get names length byte
        suba.l  a0,a0                ;zero A0
        moveq   #-$01,d3             ;timeout
        moveq   #iob.smul,d0         ;IO.SSTRG  Send MULtiple bytes
        trap    #$03
        move.w  d6,sr                ;restore status register, and back into user mode
Moving to and from the SR is a privileged instruction on 68010+
Although; QDOS Classic emulates the instruction and I assume that SMSQ/E will do the same.

Thanks, Mark


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

Re: Q_Liberator malaise

Post by janbredenbeek »

Mark Swift wrote: Sun Jul 13, 2025 2:39 pm Moving to and from the SR is a privileged instruction on 68010+
Although; QDOS Classic emulates the instruction and I assume that SMSQ/E will do the same.
Move to SR is always privileged, move from SR is privileged on the 68010+.
Minerva and SMSQ/E emulate the latter by converting it to MOVE CCR,x (which doesn't exist on the 68000/8).
QDOS Classic doesn't emulate and bails out with privilege violation.


Post Reply