Home
CBM
  ASCII-X
  BASIC
    Disk Commands
    Enter RUN mode
    Program Format
    Secret Variables
    Variable Format
    Expressions
    Keywords
      (divide)
      (equal)
      (less)
      (minus)
      (more)
      (multiply)
      (plus)
      (power)
      Abs
      And
      Append
      Asc
      Atn
      Auto
      Backup
      Bank
      Begin
      Bend
      Bload
      Boot
      Box
      Bsave
      Bump
      Catalog
      Char
      Chr
      Circle
      Close
      Clr
      Cmd
      Collect
      Collision
      Color
      Concat
      Cont
      Copy
      Cos
      Data
      Dclear
      Dclose
      Dec
      Def
      Delete
      Dim
      Directory
      Dispose
      Dload
      Do
      Dopen
      Draw
      Ds
      Ds string
      Dsave
      Dverify
      El
      Else
      End
      Envelope
      Er
      Err
      Exit
      Exp
      Fast
      Fetch
      Filter
      Fn
      For
      Fre
      Get
      Get num
      Getkey
      Go
      Gosub
      Goto
      Graphic
      Gshape
      Header
      Help
      Hex
      If
      Input
      Input num
      Instr
      Int
      Joy
      Key
      Left
      Len
      Let
      List
      Load
      Locate
      Log
      Loop
      Mid
      Monitor
      Movspr
      New
      Next
      Not
      Off
      On
      Open
      Or
      Paint
      Peek
      Pen
      Pi
      Play
      Pointer
      Poke
      Pos
      Pot
      Print
      Print num
      Pudef
      Quit
      Rclr
      Rdot
      Read
      Record
      Rem
      Rename
      Renumber
      Restore
      Resume
      Return
      Rgr
      Right
      Rlum
      Rnd
      Rreg
      Rspcolor
      Rsppos
      Rsprite
      Run
      Rwindow
      Save
      Scale
      Scnclr
      Scratch
      Sgn
      Sin
      Sleep
      Slow
      Sound
      Spc
      Sprcolor
      Sprdef
      Sprite
      Sprsav
      Sqr
      Sshape
      St
      Stash
      Step
      Stop
      Str
      Swap
      Sys
      Tab
      Tan
      Tempo
      Then
      Ti
      Ti string
      To
      Trap
      Troff
      Tron
      Until
      Using
      Usr
      Val
      Verify
      Vol
      Wait
      While
      Width
      Window
      Xor
    Syntax
    Tokens
  C128
  D64plus
  Disk
  Escape Codes
  Hardware
  PCxface
  PETSCII
  Pet2asc
Futurama
IBM PC-AT
Contact
Games
Glossary
Hall of fame
Hall of shame
Miscellaneous
Privacy policy
Programming
Twisty puzzles
KeywordAbbreviationToken (hex)Version(s)Classification
GOnoneCB2.0+Command and Statement

 
Syntax 
GO mode
 ~ or ~
GO TO lineNumber [ , lineNumber ] ...
 
ParametersTypeLegal Value(s)Default ValueNote(s)
modeUnsigned Byte64Only valid in v7.0 (C128)
lineNumberRestricted Unsigned Integer0 ~ 63999Only the first lineNumber is used.  Must be a literal number.
 
 
 
Purpose 
Machine state control (form 1); switch machine to C64 mode
Program flow control (form 2).  Transfer program execution to the start of a (typically other) program line.

 
 
Remarks 
For details of form 2, see GOTO (without a space)... note this form, with a space between GO and TO is suppose to be indentical / synomyous to the original GOTO (no space).  However, a SYNTAX ERROR will be generated if you to try to use the ON preposition with this GO TO version.  Fail!  Or as I like to say: if it ain't broke, don't fix it.
 
Form 1 is only supported on the C128 when in "native" (128) mode; i.e., it only works v7.0.  The GO 64 switches the machine into C64 mode.  If this command is used in direct mode, a prompt "ARE YOU SURE?" appears and the user must enter something beginning with Y to actually execute the command.  In a program, the statement switches to 64-mode without question.  Any program in memory is "lost" and the BASIC 2.0 start-up message displays followed by a READY prompt.  Any open files will be forgotten and this can cause file corruption; so be sure to CLOSE any files before using this command/statment.  Technicial note: computer memory is not erased, but the C64 start-up sequence resets all secret variables so that any program from 128 mode would not be seen by BASIC 2.0 (not to mention, many of the BASIC 7.0 commands would cause an error in v2.0 because they are unknown).  By poking magic numbers into RAM where a C64 cartridge would be seen, it is possible to force a program to be run when 64 mode starts.  Note a 1571 disk drive that was accessed in 128 mode before GO 64 will have automatically switched into 1571 mode and thus may not work with programs that rely on the slower 1541 timing.  If the 1571 drive was never accessed in 128 mode (or if the user holds down C= while turning on a C128) the 1571 disk drive will be in 1541-compatibility mode.  You can manually force a 1571 into 1541 "compatibility" mode by sending command U0>M0 to channel 15 of the device (see PRINT#).
 
If mode is a string expression, TYPE MISMATCH ERROR occurs.  A numeric expression will effectively be converted with INT; if it is not in the range of an unsigned byte 0 ~ 255, an ILLEGAL QUANTITY ERROR occurs.  If it is a number in that range, but not a legal value (not 64) or if mode is omitted, or if mode is not a valid expression, then SYNTAX ERROR occurs.
Example:
READY.
GO 64
ARE YOU SURE? YEP (user input)

    **** COMMODORE 64 BASIC V2 ****
 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.


 Compare With 
 
 Contrast With 
 
 See Also 

© H2Obsession, 2014