[Coco] Nitros9 high speed mode

L. Curtis Boyle curtisboyle at sasktel.net
Mon Jul 30 22:08:29 EDT 2007


On Mon, 30 Jul 2007 17:24:53 -0600, Joel Ewy <jcewy at swbell.net> wrote:

> I think this thread is suffering from insufficient specificity.  :)
>
> Paul, are you referring to the "High Speed Poke" (i.e., running the CPU
> at 1.78 MHz instead of .89 MHz,) or running a 6309 in "Native Mode"?
>
> If you mean the former, then even stock OS-9 Level II always ran the CPU
> in high (clock) speed mode.  In BASIC you achieve this by &HFFD9,0.  In
> (Nitr)OS-9, this is done automatically in the machine language code
> somewhere by storing a '0' in address &HFFD9.  The NitrOS-9 code is
> available, so the actual implementation details can easily be examined.
> But ordinarily you would not want to turn this off.
>
> If you are talking about the 6309's "Native Mode," that is also built
> into the NitrOS-9 code.  What's called "Native Mode" is an operating
> mode where the processor executes many of the CPU's instructions (those
> present in the 6809 as well as the new 6309 instructions) in fewer clock
> cycles -- getting more work done in less time.  The CPU can be switched
> into and out of native mode in software.  I don't know whether NitrOS-9
> 6309 runs in native mode full time or switches out of it occasionally.
> We have NitrOS-9 developers on this list who can tell us for sure, but I
> suspect that it runs in native mode all the time.  6309 NitrOS-9
> probably also makes use of some of the new 6309 instructions such as DIV
> and TFM that can process or move data faster than an equivalent series
> of 6809 instructions.
>
> So if you're asking about "Native Mode", then the way to avoid using
> 6309 features (CPU instructions and also native mode) is simply to run
> the 6809 version of NitrOS-9.

Both of these (from my admittedly scanty memory are in the kernal track,  
and in the REL module to be specific. If you want to change the hi-speed  
POKE (65497/65496 is the decimal version), you can even do that in BASIC09  
by just doing the POKE... OS-9/NitrOS9 sets it during initialization, and  
never touches it again on it's own.


>
> JCE
>
> Darren A. wrote:
>>
>>
>>
>>> 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
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> Coco mailing list
>> Coco at maltedmedia.com
>> http://five.pairlist.net/mailman/listinfo/coco
>>
>
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco



-- 
L. Curtis Boyle



More information about the Coco mailing list