GEOS Programmer's Reference Guide errata

last updated 2025-06-01 (p.240)
back to main GEOS page

The Programmer's Reference Guide is a great resource for GEOS programmers; unfortunately, it's riddled with misprints. When I first started to learn GEOS programming, I marked my copy as I found these errors... the hard way. Recently, I went through it and collated them for this page (and continue to find even more). There are also some places where constants were changed to make them unique to geoAssembler, which had not yet been released when the PRG was published. I've added a few corrections from the Hitchhiker's Guide to GEOS as well. ("Boyce" refers to Bo Zimmerman's revision of Alexander Boyce's GEOS Programmer's Reference Guide.) If you find any omissions or errors, please contact me: cenbe at protonmail dot com.

Programmer's Reference Guide cover
note: "s/b" means "should be"

p.10 "These memory locations devided into 15 word length variables"
s/b  "These memory locations are divided into 16 word length variables"

p.15 "there are 4 bytes from $00FC to 00FF in zpage"
s/b  "there are 4 bytes from $00FB to $00FE in zpage"

p.16 "00FC-00FE" s/b "00FB-00FE"

p.18 ResetHandle: ".jmp" s/b "jmp"

p.27 "If both bits 6 and 7 in alphaFlag are clear"
s/b  "If both bits 6 and 7 in iconSelFlag are clear"

p.30 "MAIN_BOT = 24" s/b "MAIN_BOT = 14"
     ".byte HORIZONTAL" s/b ".byte HORIZONTAL | 2"
     
     Menu Figure 2 some .byte s/b .word:
     .word ChangeDeptText
     .byte SUB_MENU
     .word ChangDeptMenu
     .word ShowcaseText
     .byte SUB_MENU
     .word ShowcaseMenu
     
p.31 .byte MENU_ACTION ; "flag to indicate a submenu"
     s/b "flag to indicate a dispatch"
     
p.36 DoMenu: There is no inline form of this API.

p.82 SetPattern: according to the Hitchhiker's Guide to GEOS,
     "SetPattern will only work correctly with patterns numbered
     0-31. To access higher number patterns, call SetPattern with a
     value of 31 and add 8 to curPattern to access pattern 32, add 16
     to access pattern 33."

p.107 geosSym has ULINEON and ULINEOFF in place of 
      UNDERLINEON and UNDERLINEOFF.
      PLAINTEXT s/b 27 (not 26).

p.108 PutString: displayBufferOn s/b dispBufferOn

p.123 "Putchar" s/b "PutChar"

p.129, 400: File header offsets for font files are given as follows:

      OFF_GHFONTID = 128 ($80)
      OFF_GHPOINT_SIZES = 130 ($82)
      OFF_GHSET_LENGTHS = 97 ($61)

      The Hitchhiker's Guide has these as:

      O_GHFONTID
      O_GHPTSIZES
      O_GHSETLEN

      Neither are in geosSym, although it does contain other O_GH
      constants.  Also, the Programmer's Reference Guide, Hitchhiker's
      Guide, and Boyce are all wrong about the word lengths of the
      point size and set length tables: it should be 15 words, not
      16. Otherwise the point size table would overlap the file info
      block (O_GHINFO_TXT), and the set length table would overlap the
      font ID (O_GHFONTID). See my article on GEOS fonts.

p.190 Synopsis: "multiplies to bytes" s/b "multiplies two bytes"

p.219 Position Command
      "The first is the x position in bytes, 0-319"
  s/b "The first is the x position in bytes, 0-39"
  
p.220 "Cancel .byte Cancel" s/b "CANCEL .byte CANCEL"
      "Yes .byte YES" s/b "YES .byte YES"
      "FUTURE4 .byte FUTURE3" s/b "FUTURE4 .byte FUTURE4"

p.222 DBVARSTR, DBGETSTRING ".byte RegNumber" s/b ".byte register"
      (pass the address, not the register number, e.g. r5, not 5)
      "DBGETFILES 15" s/b "DBGETFILES 16"
      The X offset for DBGETFILES should be in pixels, not bytes.

p.226 "To recover the screen when the display is being buffered to calls"
  s/b "To recover the screen when the display is being buffered, two calls"

p.228 The SYS_DB_ICN_WIDTH and SYS_DB_ICN_HEIGHT constants do not appear 
      in geosSym (in any case, the constant names are too long to be 
      unique to geoAssembler). The correct values (6 and 16, respectively) 
      are found on page 406.

p.230 The comment referring to the string "current disk:" should read
      "On disk:" (the comment doesn't match curDiskString below).

p.236 The BAM track table entries for tracks 2-35 are wrong (they're
      copied from track 1). Track 2 s/b 8-11; track 35 s/b 140-143.

p.240 "128 bytes. New GEOS file." s/b "256 bytes. New GEOS file."
      byte 68 "$80 + PRG" s/b "$80 + USR"
      Bytes 77-96 should end with "16-19=0's" (counting from zero).
      Bytes 117-136 should also end with "16-19=0's".
     
p.242 "Bytes 0-11 are used for the filename... Bytes 10-15 should be
      the version number" s/b "Bytes 12-15 should be the version
      number".

p.254 GetPtrCurDkNm: return value should say "pointer... 
      in the pseudo-register specified by X register".
 
p.257 FindFTypes: returns max. files - found files in r7.

p.264 SaveFile: For the argument in r10L, the commentary says the
      first directory page is 1. Testing shows that it's 0, not
      1. This error is present in the Hitchhiker's Guide as well.

      fileTrScTab is not passed; SaveFile creates it.
      
p.265 "SaveFile, therefore, expects the first two bytes of the File Header,
       which stored on disk to instead point to..."
  s/b "SaveFile, therefore, expects the first two bytes of the File Header,
       which, when stored on disk, contain $00,$FF, to instead point to..."
       
p.287 LdFile: do not use. See the Hitchhiker's Guide to GEOS, which says
      "All versions of LdFile to date under Commodore GEOS are unusable."
      Use GetFile instead; LdFile is only for internal use by GEOS.

p.291,293,295 BlkAlloc, NxtBlkAlloc, and SetNextFree mention a routine
      named ReadPortion which is not referenced anywhere else (or in
      the Hitchhiker's Guide or Boyce).

p.317 We are told how to add records to a new VLIR file, but the API
      descriptions for AppendRecord and InsertRecord are missing. Find
      them in the Hitchhiker's Guide.

p.393 geosSym has REV_ON and REV_OFF in place of REVERSEON and REVERSEOFF.

p.396 The heading "Menu" should read "Icon".

p.406 The SYS_DB_ICN_WIDTH and SYS_DB_ICN_HEIGHT constants do not
      appear in geosSym. In any case, the constant names are too long
      to be unique to geoAssembler.

p.407 The DB_ICN_X_n and DB_ICN_Y_n constants appear in geosSym as 
      DBI_X_n and DBI_Y_n.

p.410 In the memory map, 00FC-00FE s/b 00FB-00FE.

p.423 fileTrScTab is $8300, dirEntryBuf is $8400.

p.432 DoneWithIO is C25F; CopyString is C265.