00000000: 00 80 5E 55 3A 5A 45 52 4F 0D 0D 0D 20 20 20 20 |..^U:ZERO... |
00000010: 20 20 20 20 20 20 20 20 C2 59 54 45 20 C2 59 20 | .YTE .Y |
00000020: C2 59 54 45 0D 0D 20 20 20 20 20 20 20 20 20 20 |.YTE.. |
00000030: 20 42 59 20 CD 49 4B 45 20 CD 41 59 4E 41 52 44 | BY .IKE .AYNARD|
00000040: 0D 20 20 20 20 20 20 20 20 20 20 20 20 20 20 CA |. .|
00000050: 49 4D 20 D2 4F 57 0D 0D 20 20 D7 45 4C 43 4F 4D |IM .OW.. .ELCOM|
00000060: 45 20 54 4F 20 4F 55 52 20 46 49 52 53 54 20 49 |E TO OUR FIRST I|
00000070: 4E 53 54 41 4C 4C 4D 45 4E 54 20 4F 46 0D C2 59 |NSTALLMENT OF..Y|
00000080: 54 45 20 C2 59 20 C2 59 54 45 2E 20 D4 48 49 53 |TE .Y .YTE. .HIS|
00000090: 20 53 45 43 54 49 4F 4E 20 43 4F 56 45 52 53 0D | SECTION COVERS.|
000000A0: 42 45 47 49 4E 4E 49 4E 47 20 54 4F 20 49 4E 54 |BEGINNING TO INT|
000000B0: 45 52 4D 45 44 49 41 54 45 20 50 52 4F 47 52 41 |ERMEDIATE PROGRA|
000000C0: 4D 4D 49 4E 47 0D 54 45 43 48 4E 49 51 55 45 53 |MMING.TECHNIQUES|
000000D0: 2E 20 D7 45 20 48 4F 50 45 20 57 48 41 54 20 59 |. .E HOPE WHAT Y|
000000E0: 4F 55 20 4C 45 41 52 4E 20 49 4E 0D C2 59 54 45 |OU LEARN IN..YTE|
000000F0: 20 C2 59 20 C2 59 54 45 20 57 49 4C 4C 20 48 45 | .Y .YTE WILL HE|
00000100: 4C 50 20 59 4F 55 20 57 52 49 54 45 0D C2 C1 D3 |LP YOU WRITE....|
00000110: C9 C3 20 50 52 4F 47 52 41 4D 53 2E 20 C6 45 45 |.. PROGRAMS. .EE|
00000120: 4C 20 46 52 45 45 20 54 4F 20 53 45 4E 44 0D 53 |L FREE TO SEND.S|
00000130: 55 47 47 45 53 54 49 4F 4E 53 20 41 53 20 54 4F |UGGESTIONS AS TO|
00000140: 20 57 48 41 54 20 59 4F 55 27 44 20 4C 49 4B 45 | WHAT YOU'D LIKE|
00000150: 20 54 4F 0D 53 45 45 20 49 4E 20 55 50 43 4F 4D | TO.SEE IN UPCOM|
00000160: 49 4E 47 20 49 4E 53 54 41 4C 4C 4D 45 4E 54 53 |ING INSTALLMENTS|
00000170: 20 4F 46 20 C2 59 54 45 0D C2 59 20 C2 59 54 45 | OF .YTE..Y .YTE|
00000180: 2E 0D 0D 20 20 20 20 20 20 20 20 20 20 20 20 20 |... |
00000190: 20 20 20 20 20 20 20 20 20 20 20 20 2D 20 C5 44 | - .D|
000001A0: 49 54 4F 52 53 0D 0D 0D 20 20 20 20 20 20 20 20 |ITORS... |
000001B0: 20 D2 C5 C1 C4 C9 CE C7 20 C1 20 D3 C5 D1 20 C6 | ....... . ... .|
000001C0: C9 CC C5 0D 20 20 20 20 20 20 20 20 20 2D 2D 2D |.... ---|
000001D0: 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 2D 0D |---------------.|
000001E0: 0D 20 C1 20 D3 C5 D1 20 46 49 4C 45 20 49 53 20 |. . ... FILE IS |
000001F0: 41 20 46 49 4C 45 20 54 48 41 54 20 43 4F 4E 53 |A FILE THAT CONS|
00000200: 49 53 54 53 0D 4F 46 20 44 41 54 41 20 53 54 4F |ISTS.OF DATA STO|
00000210: 52 45 44 20 53 45 51 55 45 4E 54 49 41 4C 4C 59 |RED SEQUENTIALLY|
00000220: 2C 20 4F 52 20 4F 4E 45 0D 44 41 54 55 4D 20 52 |, OR ONE.DATUM R|
00000230: 49 47 48 54 20 41 46 54 45 52 20 54 48 45 20 4F |IGHT AFTER THE O|
00000240: 54 48 45 52 2E 20 D4 4F 20 52 45 41 44 0D 41 20 |THER. .O READ.A |
00000250: D3 C5 D1 20 46 49 4C 45 2C 20 59 4F 55 20 4D 55 |... FILE, YOU MU|
00000260: 53 54 20 44 4F 20 54 48 45 0D 46 4F 4C 4C 4F 57 |ST DO THE.FOLLOW|
00000270: 49 4E 47 3A 0D 0D 20 31 29 20 CF D0 C5 CE 20 54 |ING:.. 1) .... T|
00000280: 48 45 20 46 49 4C 45 2E 0D 0D 20 32 29 20 C7 C5 |HE FILE... 2) ..|
00000290: D4 20 41 20 42 59 54 45 20 46 52 4F 4D 20 54 48 |. A BYTE FROM TH|
000002A0: 45 20 46 49 4C 45 2E 0D 0D 20 33 29 20 D0 D2 C9 |E FILE... 3) ...|
000002B0: CE D4 20 49 54 20 54 4F 20 54 48 45 20 53 43 52 |.. IT TO THE SCR|
000002C0: 45 45 4E 2E 0D 0D 20 34 29 20 C3 48 45 43 4B 20 |EEN... 4) .HECK |
000002D0: 54 48 45 20 53 54 41 54 55 53 20 52 45 47 49 53 |THE STATUS REGIS|
000002E0: 54 45 52 20 46 4F 52 0D 20 20 20 20 C5 CE C4 20 |TER FOR. ... |
000002F0: CF C6 20 C6 C9 CC C5 2E 0D 0D 20 35 29 20 C9 46 |.. ....... 5) .F|
00000300: 20 49 54 27 53 20 4E 4F 54 20 54 48 45 20 C5 CE | IT'S NOT THE ..|
00000310: C4 2C 20 54 48 45 4E 20 C7 C5 D4 0D 20 20 20 20 |., THEN .... |
00000320: 41 4E 4F 54 48 45 52 20 42 59 54 45 2C 20 45 54 |ANOTHER BYTE, ET|
00000330: 43 2E 2E 2E 0D 0D 20 36 29 20 C9 46 20 49 54 20 |C..... 6) .F IT |
00000340: 49 53 20 54 48 45 20 C5 CE C4 2C 20 C3 CC CF D3 |IS THE ..., ....|
00000350: C5 20 54 48 45 20 46 49 4C 45 0D 20 20 20 20 41 |. THE FILE. A|
00000360: 4E 44 20 43 4F 4E 54 49 4E 55 45 20 57 49 54 48 |ND CONTINUE WITH|
00000370: 20 59 4F 55 52 20 50 52 4F 47 52 41 4D 2E 0D 0D | YOUR PROGRAM...|
00000380: 20 20 D4 48 45 20 46 4F 4C 4C 4F 57 49 4E 47 20 | .HE FOLLOWING |
00000390: C2 C1 D3 C9 C3 20 50 52 4F 47 52 41 4D 20 57 49 |..... PROGRAM WI|
000003A0: 4C 4C 0D 44 4F 20 4A 55 53 54 20 54 48 41 54 20 |LL.DO JUST THAT |
000003B0: 2D 2D 20 51 55 49 43 4B 4C 59 20 41 4E 44 20 45 |-- QUICKLY AND E|
000003C0: 41 53 49 4C 59 2E 0D 0D 35 20 20 C9 CE D0 D5 D4 |ASILY...5 .....|
000003D0: 20 22 C5 CE D4 C5 D2 20 C6 C9 CC C5 CE C1 CD C5 | "..... ........|
000003E0: 22 3B C6 C9 24 0D 31 30 20 CF D0 C5 CE 20 33 2C |";..$.10 .... 3,|
000003F0: 38 2C 33 2C C6 C9 24 0D 32 30 20 C7 C5 D4 23 33 |8,3,..$.20 ...#3|
00000400: 2C C1 24 3A D0 D2 C9 CE D4 C1 24 3B 0D 33 30 20 |,.$:......$;.30 |
00000410: C9 C6 20 D3 D4 3D 30 20 D4 C8 C5 CE 20 32 30 0D |.. ..=0 .... 20.|
00000420: 34 30 20 C3 CC CF D3 C5 20 33 0D 0D 20 20 C1 4E |40 ..... 3.. .N|
00000430: 44 2C 20 49 46 20 59 4F 55 20 57 41 4E 54 45 44 |D, IF YOU WANTED|
00000440: 20 54 4F 20 41 44 44 20 41 20 D0 C1 D5 D3 C5 0D | TO ADD A ......|
00000450: 41 4E 44 20 C1 C2 CF D2 D4 20 46 55 4E 43 54 49 |AND ..... FUNCTI|
00000460: 4F 4E 2C 20 59 4F 55 20 43 4F 55 4C 44 20 44 4F |ON, YOU COULD DO|
00000470: 20 53 4F 4D 45 2D 0D 54 48 49 4E 47 20 4C 49 4B | SOME-.THING LIK|
00000480: 45 20 54 48 45 20 46 4F 4C 4C 4F 57 49 4E 47 3A |E THE FOLLOWING:|
00000490: 0D 0D 35 20 20 C9 CE D0 D5 D4 20 22 C5 CE D4 C5 |..5 ..... "....|
000004A0: D2 20 C6 C9 CC C5 CE C1 CD C5 22 3B C6 C9 24 3A |. ........";..$:|
000004B0: 0D 20 20 20 D0 CF CB C5 35 33 32 38 30 2C 35 0D |. ....53280,5.|
000004C0: 31 30 20 CF D0 C5 CE 20 33 2C 38 2C 33 2C C6 C9 |10 .... 3,8,3,..|
000004D0: 24 0D 32 30 20 C7 C5 D4 23 33 2C C1 24 3A D0 D2 |$.20 ...#3,.$:..|
000004E0: C9 CE D4 C1 24 3B 3A C7 C5 D4 20 C2 24 0D 33 30 |....$;:... .$.30|
000004F0: 20 C9 C6 20 C2 24 3D 22 D0 22 20 D4 C8 C5 CE 20 | .. .$="." .... |
00000500: 37 30 0D 34 30 20 C9 C6 20 C2 24 3D 22 C1 22 20 |70.40 .. .$="." |
00000510: D4 C8 C5 CE 20 D0 D2 C9 CE D4 3A D0 D2 C9 CE D4 |.... .....:.....|
00000520: 3A 0D 20 20 20 D0 D2 C9 CE D4 22 D2 C5 C1 C4 20 |:. .....".... |
00000530: C1 C2 CF D2 D4 C5 C4 21 21 22 3A C7 CF D4 CF 20 |.......!!":.... |
00000540: 36 30 0D 35 30 20 C9 C6 20 D3 D4 3D 30 20 D4 C8 |60.50 .. ..=0 ..|
00000550: C5 CE 20 32 30 0D 36 30 20 C3 CC CF D3 C5 20 33 |.. 20.60 ..... 3|
00000560: 3A C5 CE C4 0D 37 30 20 D0 CF CB C5 35 33 32 38 |:....70 ....5328|
00000570: 30 2C 32 0D 38 30 20 C7 C5 D4 20 C1 24 3A C9 C6 |0,2.80 ... .$:..|
00000580: 20 C1 24 3C 3E 22 C3 22 20 D4 C8 C5 CE 20 38 30 | .$<>"." .... 80|
00000590: 0D 39 30 20 D0 CF CB C5 35 33 32 38 30 2C 35 3A |.90 ....53280,5:|
000005A0: C7 CF D4 CF 20 35 30 0D 0D 20 20 D7 49 54 48 20 |.... 50.. .ITH |
000005B0: 54 48 4F 53 45 20 41 44 44 49 54 49 4F 4E 53 2C |THOSE ADDITIONS,|
000005C0: 20 54 48 49 53 20 52 4F 55 54 49 4E 45 0D 57 49 | THIS ROUTINE.WI|
000005D0: 4C 4C 20 4E 4F 57 20 52 45 41 44 20 41 20 46 49 |LL NOW READ A FI|
000005E0: 4C 45 20 41 4E 44 20 4C 45 54 20 59 4F 55 20 D0 |LE AND LET YOU .|
000005F0: C1 D5 D3 C5 0D 42 59 20 50 52 45 53 53 49 4E 47 |.....BY PRESSING|
00000600: 20 22 D0 22 20 41 4E 44 20 C1 C2 CF D2 D4 20 42 | "." AND ..... B|
00000610: 59 20 50 52 45 53 53 49 4E 47 0D 22 C1 22 2E 20 |Y PRESSING.".". |
00000620: D7 48 49 4C 45 20 49 4E 20 54 48 45 20 22 D0 C1 |.HILE IN THE "..|
00000630: D5 D3 C5 C4 22 20 53 54 41 54 45 2C 20 54 48 45 |...." STATE, THE|
00000640: 0D 42 4F 52 44 45 52 20 57 49 4C 4C 20 54 55 52 |.BORDER WILL TUR|
00000650: 4E 20 52 45 44 20 55 4E 54 49 4C 20 59 4F 55 20 |N RED UNTIL YOU |
00000660: 50 52 45 53 53 0D 54 48 45 20 22 C3 22 20 4B 45 |PRESS.THE "." KE|
00000670: 59 2E 20 C1 4E 44 2C 20 41 54 20 54 48 41 54 20 |Y. .ND, AT THAT |
00000680: 54 49 4D 45 2C 20 54 48 45 0D 42 4F 52 44 45 52 |TIME, THE.BORDER|
00000690: 20 57 49 4C 4C 20 52 45 54 55 52 4E 20 54 4F 20 | WILL RETURN TO |
000006A0: 47 52 45 45 4E 20 41 4E 44 20 54 48 45 0D 50 52 |GREEN AND THE.PR|
000006B0: 4F 47 52 41 4D 20 57 49 4C 4C 20 43 4F 4E 54 49 |OGRAM WILL CONTI|
000006C0: 4E 55 45 20 50 52 49 4E 54 49 4E 47 20 54 48 45 |NUE PRINTING THE|
000006D0: 0D 46 49 4C 45 2E 0D 0D 20 20 CF 54 48 45 52 20 |.FILE... .THER |
000006E0: 46 45 41 54 55 52 45 53 2C 20 4C 49 4B 45 20 53 |FEATURES, LIKE S|
000006F0: 45 4E 44 49 4E 47 20 54 48 45 0D 46 49 4C 45 20 |ENDING THE.FILE |
00000700: 54 4F 20 54 48 45 20 50 52 49 4E 54 45 52 20 4F |TO THE PRINTER O|
00000710: 52 20 4D 4F 44 45 4D 2C 20 43 4F 55 4C 44 0D 42 |R MODEM, COULD.B|
00000720: 45 20 41 44 44 45 44 20 4A 55 53 54 20 41 53 20 |E ADDED JUST AS |
00000730: 45 41 53 49 4C 59 20 41 53 20 54 48 45 20 D0 C1 |EASILY AS THE ..|
00000740: D5 D3 C5 0D 41 4E 44 20 C1 C2 CF D2 D4 20 46 45 |....AND ..... FE|
00000750: 41 54 55 52 45 53 20 57 45 52 45 20 41 44 44 45 |ATURES WERE ADDE|
00000760: 44 2E 0D 0D 20 20 D4 48 45 20 46 49 4C 45 20 52 |D... .HE FILE R|
00000770: 45 41 44 49 4E 47 20 52 4F 55 54 49 4E 45 20 57 |EADING ROUTINE W|
00000780: 49 54 48 20 D0 C1 D5 D3 C5 0D 41 4E 44 20 C1 C2 |ITH ......AND ..|
00000790: CF D2 D4 20 46 55 4E 43 54 49 4F 4E 53 20 41 52 |... FUNCTIONS AR|
000007A0: 45 20 49 4E 43 4C 55 44 45 44 20 4F 4E 0D 53 49 |E INCLUDED ON.SI|
000007B0: 44 45 20 32 20 4F 46 20 54 48 49 53 20 49 53 53 |DE 2 OF THIS ISS|
000007C0: 55 45 2E 20 CA 55 53 54 20 CC CF C1 C4 0D 22 D2 |UE. .UST .....".|
000007D0: C5 C1 C4 C6 C9 CC C5 2E C2 C1 D3 22 2C 38 20 41 |...........",8 A|
000007E0: 4E 44 20 D2 D5 CE 20 54 4F 20 52 45 41 44 20 41 |ND ... TO READ A|
000007F0: 0D D3 C5 D1 20 46 49 4C 45 2E 0D 0D 20 20 20 20 |.... FILE... |
00000800: 20 20 20 20 2A 2A 2A 2A 20 C5 4E 44 20 CF 46 20 | **** .ND .F |
00000810: D4 45 58 54 20 2A 2A 2A 2A 0D |.EXT ****. |
..^U:ZERO... BYTE BY BYTE..
BY MIKE MAYNARD. J
IM ROW.. WELCOME TO OUR FIRST INSTALLME
NT OF.BYTE BY BYTE. THIS SECTION COVERS.
BEGINNING TO INTERMEDIATE PROGRAMMING.TE
CHNIQUES. WE HOPE WHAT YOU LEARN IN.BYTE
BY BYTE WILL HELP YOU WRITE.BASIC PROGR
AMS. FEEL FREE TO SEND.SUGGESTIONS AS TO
WHAT YOU'D LIKE TO.SEE IN UPCOMING INST
ALLMENTS OF BYTE.BY BYTE...
- EDITORS... READING
A SEQ FILE. ------------------.
. A SEQ FILE IS A FILE THAT CONSISTS.OF
DATA STORED SEQUENTIALLY, OR ONE.DATUM R
IGHT AFTER THE OTHER. TO READ.A SEQ FILE
, YOU MUST DO THE.FOLLOWING:.. 1) OPEN T
HE FILE... 2) GET A BYTE FROM THE FILE..
. 3) PRINT IT TO THE SCREEN... 4) CHECK
THE STATUS REGISTER FOR. END OF FILE.
.. 5) IF IT'S NOT THE END, THEN GET.
ANOTHER BYTE, ETC..... 6) IF IT IS THE E
ND, CLOSE THE FILE. AND CONTINUE WITH
YOUR PROGRAM... THE FOLLOWING BASIC PR
OGRAM WILL.DO JUST THAT -- QUICKLY AND E
ASILY...5 INPUT "ENTER FILENAME";FI$.10
OPEN 3,8,3,FI$.20 GET#3,A$:PRINTA$;.30
IF ST=0 THEN 20.40 CLOSE 3.. AND, IF YO
U WANTED TO ADD A PAUSE.AND ABORT FUNCTI
ON, YOU COULD DO SOME-.THING LIKE THE FO
LLOWING:..5 INPUT "ENTER FILENAME";FI$:
. POKE53280,5.10 OPEN 3,8,3,FI$.20 GET
#3,A$:PRINTA$;:GET B$.30 IF B$="P" THEN
70.40 IF B$="A" THEN PRINT:PRINT:. PRI
NT"READ ABORTED!!":GOTO 60.50 IF ST=0 TH
EN 20.60 CLOSE 3:END.70 POKE53280,2.80 G
ET A$:IF A$<>"C" THEN 80.90 POKE53280,5:
GOTO 50.. WITH THOSE ADDITIONS, THIS RO
UTINE.WILL NOW READ A FILE AND LET YOU P
AUSE.BY PRESSING "P" AND ABORT BY PRESSI
NG."A". WHILE IN THE "PAUSED" STATE, THE
.BORDER WILL TURN RED UNTIL YOU PRESS.TH
E "C" KEY. AND, AT THAT TIME, THE.BORDER
WILL RETURN TO GREEN AND THE.PROGRAM WI
LL CONTINUE PRINTING THE.FILE... OTHER
FEATURES, LIKE SENDING THE.FILE TO THE P
RINTER OR MODEM, COULD.BE ADDED JUST AS
EASILY AS THE PAUSE.AND ABORT FEATURES W
ERE ADDED... THE FILE READING ROUTINE W
ITH PAUSE.AND ABORT FUNCTIONS ARE INCLUD
ED ON.SIDE 2 OF THIS ISSUE. JUST LOAD."R
EADFILE.BAS",8 AND RUN TO READ A.SEQ FIL
E... **** END OF TEXT ****.
×
C64 Image
> CLICK IMAGE PREVIEW FOR FULL MODAL