home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
STARLET
/
ZBAS.ZIP
/
ZBAS.DOC
< prev
Wrap
Text File
|
1990-01-06
|
13KB
|
428 lines
FOREWORD
ZBA╙á wa≤ originall∙ writteε t∩ ruε unde≥ NortΦ Sta≥ DO╙ anΣ ì
full∙ replacσ NortΦ Sta≥ BASIC«á Rathe≥ thaε completel∙ rewritinτ ì
al∞á disδá I/╧á functions¼á ╔ decideΣ t∩á usσá aεá existinτá CP/═ ì
interfacσ anΣ rewritσ anΣ full∙ integratσ it«á Therefore¼ ZBA╙ i≤ ì
unablσá t∩ acces≤ file≤ tha⌠ havσ an∙ filenamσ othe≥ thaεá *.?ZB« ì
Thσá las⌠á tw∩ letter≤ oµ thσ filσ typσ mustô bσ "ZBó fo≥ ZBA╙á t∩ ì
recognizσá thσá filσ a⌠ all«á Fo≥ morσ informatioε oεá filσá namσ ì
syntax refer to the disk related commands.
ZBA╙ i≤ full∙ NortΦ Sta≥ BASI├ synta° compatible¼á witΦá al∞ ì
it'≤á advantage≤ anΣ disadvantages«á I⌠ perform≤ slightl∙á faste≥ ì
thaεá NortΦá Sta≥ BASIC«á And¼á oµ course¼á i⌠ offer≤ somσá extrß ì
command≤ anΣ run≤ unde≥ CP/═ full∙ configured¼á s∩ yo⌡ don'⌠ havσ ì
to go through the hassle of interfacing it yourself.
ZBA╙á i≤á thσ produc⌠ oµ tw∩ yearsº worδ tryinτá t∩á improvσ ì
NortΦá Sta≥á BASI├á withou⌠á losinτá thσá compatibility«á Iεá al∞ ì
fairnes≤ ╔ havσ t∩ admi⌠ tha⌠ withou⌠ ß disassembl∙ oµ NortΦ Sta≥ ì
BASIC release 4.0 I would have not been able to do it.
1
List of directly executable commands only
ALOAD APPEND AUTO BYE CAT COMPACT
CONT DELETE EDIT LIST LOAD MEMSET
NSAVE PSIZE REN RUN SAVE SCR
List of statements
CHAIN CLOSE CREATE DATA DEF FN DESTROY
ELSE END ERRSET EXIT FILL FOR
GOSUB GOTO IF INPUT INPUT1 LET
LINE NEXT NOENDMARK ON OPEN OUT
PRINT READ REM RESET RESTORE RETURN
SORT SORT1 STOP TROFF TRON WRITE
List of built-in functions
ABS ASC ATN CALL CHR$ COS
EXAM EXP FILE FILEPTR FILESIZE FREE
INCHAR$ INP INT LEN LOG RND
SIN SGN SQRT STR$ TYP VAL$
Al∞á thσá keyword≤ whicΦ arσ identica∞ t∩ NortΦá Sta≥á BASI├ ì
synta°á wil∞ behavσ iε exactl∙ thσ samσ manner«á ListeΣ belo≈ arσ ì
the differences between ZBAS and North Star BASIC.
2
ADDED COMMANDS AND STATEMENTS
ALOAD
Thσá ALOA─ commanΣ i≤ simila≥ t∩ thσ LOA─ command«á I⌠ will¼ ì
howeve≥á loaΣ ß filσ oµ typσ .2Z┬ whicΦ i≤ iεá ASCII«á Therefore¼ ì
ZBA╙ program≤ caε no≈ bσ prepareΣ usinτ aε editor« Thσ file≤ mus⌠ ì
conform to the following simple rules:
1« N∩ empt∙ line≤ o≥ line≤ startinτ witΦ ß non-numeriπ ASCI╔ ì
character.
2. Terminated by a Control/Z.
Afte≥ loadinτ thσ file¼ ZBA╙ wil∞ tokenizσ thσ program« Thi≤ ì
caε takσ froε ß fe≈ second≤ t∩ a≤ mucΦ a≤ onσá minute¼á dependinτ ì
on the size of the program.
COMPACT
Thσ COMPAC╘ commanΣ work≤ oε thσ loadeΣ prograφ anΣá remove≤ ì
al∞á unnecessar∙ blank≤ fo≥ fas⌠ execution«á Blank≤ insidσ quoteΣ ì
string≤á anΣ RE═ statement≤ arσ lef⌠ untouched«á Wheε COMPAC╘á i≤ ì
finished¼á al∞ prograφ variable≤ anΣ datß wil∞ bσ los⌠ anΣ i⌠ ha≤ ì
to be re-run. COMPACT works only in direct mode.
RESET
RESE╘ i≤ useΣ afte≥ ß disδ changσ t∩ reinitializσ BDOS«á It¼ ì
a≤á wel∞á a≤ al∞ followinτ ne≈ keywords¼á i≤ botΦá executablσá iε ì
program- and direct mode.
SORT and SORT1
SOR╘ anΣ SORT▒ worδ oε strinτ variable≤ only« SOR╘ sort≤ thσ ì
strinτ iε ascendinτ order¼ whilσ SORT▒ sort≤ iε descendinτ order« ì
Thσá synta° is║á SOR╘ <strinτá variable>,<fields>,<fielΣá length>à ì
wherσ <strinτ variable╛ caε bσ an∙ lega∞ strinτ variable¼ sucΦ a≤ ì
A$¼á X9$¼á F$(7,99)¼ B$(S,E)¼ etc« <fields╛ i≤ thσ numbe≥ oµ sub-ì
string≤á t∩ bσ sorteΣ anΣ <fielΣ length╛ i≤ thσ sizσ oµ thσá sub-ì
strinτ whicΦ represent≤ thσ datß t∩ bσ sorted«á This¼á oµ course¼ ì
mean≤ tha⌠ witΦ tw∩ differen⌠ substrings¼á thσ shorte≥ onσ ha≤ t∩ ì
bσá paddeΣá (usuall∙á witΦ blanks.⌐ Thσ produc⌠ oµá <fields╛á anΣ ì
<fielΣá length╛ mus⌠ alway≤ bσ equa∞ t∩ o≥ les≤ thaε thσ sizσá oµ ì
thσá strinτá referenceΣ iε thσ strinτ variable«á Sincσá al∞á sub-ì
string≤ havσ t∩ bσ oµ equa∞ length¼á thσ lengtΦ oµ al∞ substring≤ ì
i≤ usuall∙ determineΣ b∙ thσ lengtΦ oµ thσ longes⌠ datß item.
3
EXAMPLES:
10 DIM A$(1000)
20 ... build string etc.
30 SORT A$,5,LEN(A$)/5
Iε thi≤ case¼á eacΦ substrinτ i≤ assumeΣ t∩ bσ 200á character≤ ì
long¼á witΦá 5á substring≤á fo≥á ß tota∞á oµá 100░á bytes«á Thσ ì
following example would produce an error, since 5 * 300 > 1000:
30 SORT A$,5,300
Iεá thσá nex⌠ case¼á n∩ erro≥ woulΣá occur¼á bu⌠á byte≤á 50░ ì
through 1000 in A$ would be left untouched:
30 SORT A$,5,100
Oµá coursσá i⌠á i≤ als∩ possiblσ t∩ usσá comple°á arithmetiπ ì
expressions in the sort statement:
30 SORT A$(N(I),N(J)),FNX(B/5),(N(I)-N(J))/(B/5)
Whethe≥á o≥ no⌠ i⌠ woulΣ worδ depend≤ solel∙ oε whethe≥á thσ ì
expressions evaluate to "in bounds."
TRON, TROFF
TRO╬á anΣ TROF╞ arσ useΣ t∩ turε thσ TRacσ flaτ O╬ anΣá OFF« ì
Iε tracσ mode¼á al∞ linenumber≤ arσ displayeΣ iε squarσá bracket≤ ì
before they are executed.
Fo≥á furthe≥ example≤ iε thσ forφ oµ ß prograφ LOA─ anΣá RU╬ ì
the file "TEST.2ZB" which is included in this package.
4
PECULIARITIES
ZBA╙á fo≥á CP/═ i≤ ß compromise«á ╔ decideΣ no⌠ t∩á writσá ß ì
completσá ne≈ se⌠ oµ disδ I/╧ routines¼á bu⌠ rathe≥ settleΣ fo≥ ß ì
quitσá satisfactor∙á performancσá usinτá ßá highl∙á modifieΣá anΣ ì
trimmeΣ NSCP═ interface«á Thi≤ interfacσ wa≤ writteε fo≥ usσ witΦ ì
NortΦá Sta≥ BASI├ releasσ ┤ singlσ densit∙ anΣ pu⌠ iε thσá publiπ ì
domaiεá b∙ thσ CP/═ Use≥ Group«á ╔ modifieΣ anΣ redistributeΣá i⌠ ì
fo≥ usσ witΦ Doublσ Densit∙ BASI├ 5.▓ anΣ i⌠ i≤ availablσ oε man∙ ì
RCP═ systems«á Thσ followinτ i≤ ß lis⌠ oµ thing≤ t∩ watcΦ ou⌠ fo≥ ì
when using ZBAS.
1«á ZBA╙á filσ type≤ arσ .?Z┬ wherσ ┐á i≤ thσ "NortΦ Sta≥á filσ ì
type,ó iε ASCII« Fo≥ example¼ "TEST.2ZBó woulΣ bσ ß loadablσ ZBA╙ ì
prograφ anΣ "DATA,3ZBó woulΣ bσ ß datß file« Pleasσ notσ tha⌠ tw∩ ì
file≤á witΦá thσ samσ name¼á bu⌠ differen⌠á filσá type¼á sucΦá a≤ ì
"TEST.2ZBó anΣ "TEST.3ZBó cannotà coexis⌠ oε thσ samσ diskíá Also¼ ì
if your CP/M directory shows the following files:
TEST .FZB TEST .2ZB TEST .ASM
Thσá filσ endinτ iε .AS═ woulΣ bσ inaccessiblσ b∙ ZBAS«á Thσ filσ ì
TEST.FZ┬á isàá accessible¼á bu⌠ duσ t∩ thσ fac⌠á thσá TEST.2Z┬á i≤ ì
second in the directory, it could not be loaded by ZBAS.
2«á Normally¼á ZBA╙á datß file≤ usσ thσ filσ typσ "3ó (a≤ NortΦ ì
Sta≥á BASI├ does,⌐ bu⌠ 30╚ i≤ addeΣ t∩ thσ filσ typσ iε orde≥á t∩ ì
bσ ablσ t∩ proces≤ anΣ displa∙ it«á Yo⌡ caε CREAT┼ ß filσ oµ typσ ì
ε iε ZBAS¼ wherσ ε mus⌠ bσ betweeε ░ anΣ 79¼ sincσ 79+48=127╗ thσ ì
highes⌠á displayablσ characte≥ iε ASCII«á ┴ typσ greate≥ thaεá 7╣ ì
will cause the actual file type to become (type MOD 79.)
3«á Internally¼á ZBA╙á simulate≤ ß NortΦ Sta≥ DO╙á environment« ì
Therefore¼á regardles≤á oµ wha⌠ drivσ yo⌡ arσ loggeΣá into¼á ZBA╙ ì
alway≤á default≤ t∩ A║á anΣ othe≥ drive≤ havσ t∩ bσá specificall∙ ì
referenced¼á NortΦ Sta≥ fashion« Fo≥ example¼ t∩ loaΣ C:TEST.2BZ¼ ì
yo⌡á havσá t∩ typσ "LOA─ TEST,3ó eveε thougΦ CP/═ ma∙á bσá loggeΣ ì
into drive C:
4« ZBA╙ caε bσ re-executeΣ witΦ thσ ZCP╥ "GOó commanΣ o≥ witΦ ß ì
filσ "GO.COMó oµ sizσ 0k«á Thσ loadeΣ program¼á iµ any¼á wil∞á bσ ì
preserved.
5«á ZBA╙á caε bσ madσ t∩ auto-ruε ß filσ iε thσ samσ fashioε a≤ ì
NortΦá Sta≥á BASIC«á Thesσá arσá thσá step≤á t∩á accomplisΦá thi≤ ì
(knowledge of CP/M utilities is assumed.)
Determine the size of ZBAS in 256-byte pages.
Now¼ executσ ZBA╙ anΣ loaΣ thσ prograφ t∩ bσ autostarted« D∩ ì
NO╘ ruε thσ programíá Executσ PSIZ┼ t∩ finΣ thσ prograφ size« AdΣ ì
the number to the size of ZBAS.
No≈á se⌠ thσ AUTO╙ flaτ t∩ ░ b∙ executinτ FIL╠ 261,0«á Also¼ ì
disable the WARMSTART flag with FILL 260,0.
Leavσ ZBA╙ witΦ BY┼ anΣ d∩ ß SAV┼ x° FILENAME.COM¼á wherσ x° ì
is the total size of ZBAS plus the program, as obtained above.
5
6«á ZBA╙ wil∞ no≈ "understandó lowe≥ casσ input« Al∞ lowe≥ casσ ì
character≤á typeΣá iεá eithe≥ a≤ ß commanΣá o≥á wheεá enterinτá ß ì
prograφá wil∞á bσá capitalizeΣ beforσá the∙á arσá executed«á Tex⌠ ì
encloseΣ iε quote≤ (strinτ literals⌐ wil∞ bσ lef⌠ unchanged«á Thσ ì
capitalization does not affect text typed at an INPUT prompt.
7«á Iµá yo⌡á d∩ no⌠ usσ NortΦ Sta≥ hardware¼á yo⌡ mustà se⌠á thσ ì
CONT╥á bytσ t∩ 0¼á o≥ yo⌡ wil∞ bσ forceΣ t∩ cold-boo⌠ ever∙á timσ ì
yo⌡á executσ ß prograφ whicΦ use≤ ß "RND(-1)ó statement«á Iµá yo⌡ ì
usσá NortΦá Sta≥á hardware¼á thi≤ bytσ mus⌠ bσ se⌠á t∩á thσá nos⌠ ì
significan⌠ bytσ oµ you≥ controlle≥ address« Notσ tha⌠ thi≤ auto-ì
seeding feature will not work in non-North Star hardware.
8«á Therσá arσá tw∩ morσ features║á Thσ commanΣá linσá (o≥á an∙ ì
prograφá line¼á fo≥ tha⌠ matter¼á ma∙ no≈ bσ u≡ t∩ 25╡ character≤ ì
long«á I⌠ default≤ t∩ 8░ characters/line¼ bu⌠ caε bσ changeΣ witΦ ì
thσá LIN┼ command«á Wheε printinτ ß prograφ listinτ witΦ LIS╘á #▒ ì
(t∩á thσá LST║á device,⌐á thσá outpu⌠á wil∞á bσá paged«á Thi≤á i≤ ì
accomplisheΣ b∙ sendinτ ß Forφ FeeΣ characte≥ a⌠ thσ star⌠ oµ thσ ì
listinτá anΣá afte≥ ever∙ 6░ lines«á Thσ printe≥ pagσá lengtΦá iε ì
lines is changeable (see the customization notes.)
9« Revisioε 1.│ introduce≤ thσ ne≈ ALOA─ commanΣ fo≥ ASCI╔ filσ ì
loading« ╔ aφ workinτ oε ASAVE¼ bu⌠ ma∙ no⌠ implemen⌠ i⌠ fo≥ somσ ì
time« ╔ havσ thereforσ includeΣ TOASCII.2Z┬ iε thσ package¼ whicΦ ì
is an un-tokenizing program for ZBAS.
6
CUSTOMIZING ADDRESSES
Thσ followinτ i≤ ß shor⌠ lis⌠ oµ importan⌠ addresse≤ iε ZBA╙ ì
and their function.
ORG 100H
ZBASENTRY: JMP START
LINES: DB 80 ;console line length
COLDFLAG: DB 0 ;this flag will be set to 1
;by ZBAS when started. MUST be
;reset to 0 for AUTOS!
AUTOS: DB 1 ;auto start flag
;set to 0 for auto start
BOOTPROM: DB 0FCH ;set to YOUR controller addr
;or 0 for non-N* hdwr
DW PRTHEAD ;points to the line index
;pointer for console
PAGES: DB 24 ;number of lines on console
BSPC: DB 8 ;backspace character
PPAGE: DB 60 ;number of lines on printer,
;FF sent after reaching it.
CONTCON: DB 0 ;set to 1 to inhibit ^C
7