On 28 Feb 2007, at 16:56, Rich Mellor wrote:

>
>>> Is there an easy way under QDOS to check which chip is in use -  
>>> if it
>>> is a
>>> 68000 or 68008 I would use 2 (or 4) MOVE.B commands instead?   
>>> SMSQ does
>>> implement the processor in the system variables, but it is not  
>>> present
>>> on
>>> QDOS alas.
>>
>> Here is what smsqe does:
>>
>>      move    #$3700,sr     !!!!!!!!!
>>      move.w  sr,d1
>>      cmp.w   #$2700,d1                ; 68000?
>>      beq.s   copy                     ; ... yes
>>      move.w  #$2700,sr                ; ... no, reset to normal
>
>
> OK I should implement a similar routine to this.  George also  
> provided a
> solution, but this seems easier.


The easiest way to distinguish between 68020+ and the others is:

        MOVEM.L A7,-(A7)
        CMPA.L          (A7),A7
        ADDQ.L          #4,A7   ;Reset A7 and leave condition codes unaltered
        BEQ             LOW     ;Not 68020+

This method did not work on QPC2 until Marcel altered it. Of course  
now QPC2 is 68020+.

To use either of these methods is OK with real 68xxx hardware (though  
the "sr" method does require to be carried out in supervisor mode).  
The trouble with emulators is that you need to be sure that "sr" or  
MOVEM.L quirks are programmed into the emulator. I thought it safer  
to try a real 68020+ instruction, such as BFTST, to check the type of  
machine. This is much more likely to be a proper test for an emulator.

George
_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to