<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Tue, 14 Jan 1997 11:59:26 +0000
From   : "David Ralph Stacey" <drs1@...>
Subject: Re: How to read/write *OPT 4 parameter

Hi.

Mark wrote

> Therefore: does anyone know if there's a non-DFS-specific way
> of reading and writing this parameter?

and

> Apparently I was wrong. There is a mention in the AUG
> about how to *read* the *OPT4 parameter (boot option)
> on a BBC from a disk. This can be done using OSGBPB 4
> (or something like that).

Hey, I spent a good ten minutes writing this program last night, so you're
going to get it, like it or not ;-) Here it is, folks:

   10 REM >ReadOpt
   20 REM Reads boot-up option from
   30 REM a disc. Will work with Acorn
   40 REM DFS, ADFS and compatibles.
   50 REM (c) Dave Stacey, Jan 1997
   60 :
   70 DIM buffer 256
   80 osgbpb = &FFD1
   90 :
  100 REM Select drive to scan here by
  110 REM using *DRIVE n or *MOUNT n.
  120 REM The currently selected drive
  130 REM is scanned; you cannot select
  140 REM the drive in the parameter
  150 REM block.
  160 :
  170 ?&70 = 0
  180 !&71 = buffer
  190 :
  200 A% = 5
  210 X% = &70
  220 Y% = 0
  230 CALL osgbpb
  240 :
  250 title_len = ?buffer
  260 option_addr = buffer + title_len + 1
  270 option = ?option_addr
  280 :
  290 PRINT "Boot-up option = ";option

> Strangely enough, the AUG does not mention a way
> to *write* the boot option

You have to use *opt 4, however if you're writing in machine code, it may be
easier to use osbyte 0x8b.

Hope this helps,

Dave Stacey.


<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>