Dilwyn Jones writes:

Does anyone have information on the format of _sav basic files (as used by Liberation Software's QSAVE utility and the equivalent command in SBASIC)?

Heres (an incomplete) decode of the file structure. Below that an example file. HTH

Per
----------------
QSAVE file structure
March 22nd 2001

*
Head
        dc.w 'Q1'            00   flag

        dc.w $0380           02   ? version ? This with SMSQ/E2.xx
                                  $0380 => Hex & bin & ?
$02C0, $0000 from Norman - dont know what it implies, perhaps vanilla?

        dc.w count           04   number of names

        dc.w source-names    06   size of name list

        dc.w lines           08   number of lines in program

*
names                        0A   start names list


For each name:

        dc.w type            00   bits 0..11 as for name-table entry
                                  bits 12..15 ?
                                  bit #12: var is paramter
                                  bit #13: var is ?
        dc.w valp            02   value pointer? Always 0?

        dc.w nlen            04   name length

        dc.b namechars       06.. name bytes, padded to even number


*
source

        actual tokenised SB program file

-------------------

Example code of test program (SMSQ/E):

        10 REMark Test
        20 number=1
        30 PRINT number
        40 number = two
----

0000    dc.w    'Q1'            flag

        dc.w    $0380           ? vers? Ive seen 0B40, 0100, 120,.

        dc.w    3               count names

        dc.w    source-names    size of name list

        dc.w    4               line count

names
        dc.w    $0800
        dc.w    $0000
        dc.w    5,'PRINT '

        dc.w    $0202 type Top bit or two set on some, for some reason
        dc.w    $0000
        dc.w    6,'number'

        dc.w    $0202 type
        dc.w    $0000
        dc.w    3,'two '

source
        dc.w    $0010
        dc.w    $8D00   line number
        dc.w    10                              10
        dc.w    $811E   REMark                REMark
        dc.w    $8C00   rem text
        dc.w    4,'Test'                       Test
        dc.w    $840A   eol
        dc.w    $0002   ?

        dc.w    $8D00
        dc.w    20                              20
        dc.w    $8800  name                    number
        dc.w    $0001  name index
        dc.w    $8401  =                         =
        dc.w    $F801
        dc.l         $40000000  float            1
        dc.w    $840A  eol

        dc.w    $FFFE  ?
        dc.w    $8D00  line number
        dc.w    30                              30
        dc.w    $8800  name                    PRINT
        dc.w    $0000  name index
        dc.w    $8001  one space
        dc.w    $8800  name                    number
        dc.w    $0001  name index
        dc.w    $840A  eol

        dc.w    $0004  ?
        dc.w    $8D00  line num
        dc.w    40
        dc.w    $8800  name                    number
        dc.w    $0001  index
        dc.w    $8001  space
        dc.w    $8401  =                         =
        dc.w    $8001  space
        dc.w    $8800  name                     two
        dc.w    $0002  index
        dc.w    $840A  eol


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to