[Coco] Nitros9 high speed mode

Darren A. darccml at hotmail.com
Mon Jul 30 18:17:01 EDT 2007




>From: "Paul Fitch"
>
><snip>
>
>In that case, is the high speed mode turned on "automatically"?  And how
>would I be able to tell?
>
>Or if not turned on automatically, what command or system call is used to
>tell Nitros to use the high speed mode?  And what command or system call is
>used to confirm that it has been done?
>
>
>--

I dont know if Nitros9 has any built-in facility for this, but when I want 
to test whether my code is running in fast mode or standard mode I use the 
following subroutine:

MODETST   PSHS    A,DP,X,Y,U       ; PRESERVE REGISTERS
          TFR     W,Y              ; Y = W (6309) / Y = #$FFFF (6809)
          CLRA                     ; SET CC.Z (ASSUME FAST-MODE)
          BSR     L2               ; PUSH FAST-MODE RTI ADDRESS
          BNE     L1               ; BRANCH IF NOT IN FAST-MODE
          TFR     X,W              ; RESTORE ORIGINAL VALUE OF W (6309)
L1        PULS    A,DP,X,Y,U,PC    ; RESTORE REGISTERS AND RETURN
L2        BSR     L3               ; PUSH STANDARD-MODE RTI ADDRESS
          INCA                     ; CLEAR CC.Z CAUSE WE AINT IN FAST-MODE
          RTS                      ; POP STANDARD-MODE RTI ADDRESS
L3        PSHS    CC,A,B,DP,X,Y,U  ; STACK REGISTERS FOR STANDARD-MODE RTI
          ORCC    #$80             ; SET [E]NTIRE FLAG FOR RTI
          RTI                      ; RETURN TO MODE-SPECIFIC LOCATION

This subroutine can be executed on both 6809 and 6309 processors. It returns 
with the Z flag cleared when running in standard mode (or on a 6809). It 
returns with the Z flag set when running in fast mode (6309 only). All 
registers (including E and F) are preserved.

Darren

_________________________________________________________________
Don't get caught with egg on your face. Play Chicktionary!  
http://club.live.com/chicktionary.aspx?icid=chick_hotmailtextlink2




More information about the Coco mailing list