Commodore‎ > ‎BASIC‎ > ‎Keywords‎ > ‎

FAST

Keyword Abbreviation Token (hex) Version(s) Classification
FAST F{Shift+A} FE 25 7.0 Command and Statement

  Syntax  
FAST
 
  Purpose  
Machine state managment.  Directs the CPU to operate at maximum speed.

 
  Remarks  
FAST sets the computer to operate at its fastest speed.  On the C128, this is about 2MHz and, except for I/O routines, the BASIC program will run about twice as fast as normal.  In this mode, the VIC-II (40-Column display) is disabled, so it is only recommended for programs running in 80-column mode, or perhaps for brief periods in 40-Column mode where user interaction is not needed. 
 
Note that any SPRITEs that are enabled will continue to slow down the CPU a bit (generally two CPU cycles for every raster of each active sprite).  Because the SPRITEs can not be seen, they should be disabled as well for maximum speed. 
 
The system "Jiffy Clock" still updates at the normal rate of 60 units ("jiffies") per second (see TI/TI$), regardless of FAST or SLOW mode.  The SLEEP statement uses the Jiffy Clock so it is not affected, but timing delays using FOR/NEXT will execute twice as quickly (as compared to SLOW mode).
 
Technical note (this is really outside of BASIC): During I/O routines (except to the keyboard/screen) the KERNAL will momentarily change the CPU speed to "slow" 1MHz mode, but then restore the previous speed setting when done.
 
Attempting to supply a parameter to FAST will generate SYNTAX ERROR.
 
On the C64, some programs were written that would blank the VIC-II screen to increase speed.  That improves speed by about 10%, but FAST improves speed by about 100% -- a big difference.  FAST is not possible on a real C64, but using POKE 53296,1 will enable 2MHz speed on a C128 that is in 64-mode (you should also blank the scren); do not attempt any external I/O in this state!  (The C128 is designed to deal with this, but not the C64 or 64-mode.)
 
Example:
SLOW : FOR T = 1 TO 1000 : NEXT
(delay about 1.4 seconds)

READY.
FAST : FOR T = 1 TO 1000 : NEXT
(delay about 0.7 seconds)

READY.
 
  Compare With  
 
  Contrast With  
 
  See Also  
FOR, PLAYSLEEPSOUNDTI, TI$ 

© H2Obsession, 2014
Comments