[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CP/M disk format question



On Jul 12, 10:44 pm, pau...@saaf.se (Paul Schlyter) wrote:
> In article <916eae14-3083-4ff3-9eb8-0130f7a1a...@b1g2000hsg.googlegroups.com>,
>
>
>
>
>
> jonnosan  <jonno...@gmail.com> wrote:
> >On Jul 12, 6:42=A0pm, pau...@saaf.se (Paul Schlyter) wrote:
>
> >> The GW-BASIC-tokens.html web page stated that GW-BASIC never stored
> >> the line addresses, only the line numbers, when a GW-BASIC program
> >> was SAVE'd in tokenized format. =A0Here MBASIC behaved differently:
> >> if the program in memory had line addresses instead of line numbers,
> >> the SAVE'd program would also contain line addresses, if it was saved
> >> in tokenized format. =A0Back when I still wrote some programs in
> >> MBASIC, I therefore used to execute the program first, thoroughly enough
> >> to make sure all GOTO's/GOSUB's had been executed, before I SAVE'd
> >> the program in tokenized format - then it would execute slightly faster
> >> the next time I LOAD'ed and RUN'ned it. =A0If the program was to be saved=
> > in
> >> ASCII format, this didn't matter of course.
>
> >Any chance you could send me some disk images with files that contain
> >line addresses instead of line numbers? I haven't come across this yet
> >in any of the (quite limited) images I've tested my code against.
>
> You should be able to create such images yourself easily.  Write a short
> MBASIC programs which contains GOTO statements.  SAVE it in tokenized format
> before running your program for the first time.  Next, run your program,
> and afterwards SAVE it again to a new file.  Exit MBASIC and DUMP the two
> tokenized files and check the differences.
>
> If you don't have access to an Apple CP/M computer, then the Apple Oasis
> emulator should serve fine.
>
> --
> ----------------------------------------------------------------
> Paul Schlyter,  Grev Turegatan 40,  SE-114 38 Stockholm,  SWEDEN
> e-mail:  pausch at stjarnhimlen dot se
> WWW:    http://stjarnhimlen.se/- Hide quoted text -
>
> - Show quoted text -

Paul,

I've got an image with an MBASIC.COM that identifies itself as
follows:

BASIC-80 Rev. 5.2
[Apple CP/M Version]
Copyright (C) 1980 by Microsoft
Created: 12-Nov-80

I loaded this under OASIS, and typed in the following program:
10 GOTO 100
20 GOTO 200
30 PRINT "DONE"
40 END
100 GOTO 20
200 GOTO 30

I then saved it as "UNRUN.BAS", and then ran it 3 times in a row, then
saved it again as "RUN.BAS".
When I do a hex dump of these 2 files, they are identical, and are:

00	FF 99 62 0A 00 89 20 0E 64 00 00 A3 62 14 00 89  .b... .d..#b...
10	20 0E C8 00 00 B0 62 1E 00 91 20 22 44 4F 4E 45   .H..0b... "DONE
20	22 00 B6 62 28 00 81 00 C0 62 64 00 89 20 0E 14  ".6b(...@bd.. ..
30	00 00 CA 62 C8 00 89 20 0E 1E 00 00 00 00 1A 72  ..JbH.. .......r
40	21 F5 27 22 01 00 2A DE F3 22 06 26 0E 0C CD 05  !u'"..*^s".&..M.
50	00 32 EE 08 B7 21 14 15 CA D6 5E 21 21 22 22 EF  .2n.7!..JV^!!""o
60	08 21 FE FF 22 67 08 AF 32 62 08 32 33 0B 32 C3  .!~"g./2b.23.2C
70	0C 32 BD 0C 32 58 08 21 00 00 22 5A 08 32 30 F0  .2=.2X.!.."Z.20p

This is using line numbers only, not line addresses. Maybe the
behaviour you described requires a different version of MBASIC?

Regards

Jonno