Version string display on startup

From BeebWiki
Jump to: navigation, search

Some programs and transient utilities optionally display their version string on startup. Many do this by reading the ANFS 'Display Version' configuration setting set with *-Net-Opt8,2 or *-Net-Opt8,3. This can easily be done with the following code:

   LDA #&A1      :\ A=&A1 to read Config settings
   LDX #&11      :\ Location 17 is ANFS settings
   LDY #&00      :\ Preload Y with &00 if no response
   JSR OSBYTE    :\ Read Config setting
   TYA           :\ Set N flag from returned setting
   BPL NoMessage :\ If b7=0, don't print message
   \ Print message
   .NoMessage

Similarly in BASIC:

   IF FNbyte(161,17,0)AND&80:PRINT version$

Jgharston 18:59, 30 August 2007 (BST)