""

%PAGE

7. AOBE OPOPAMM BBOA-BBOA

7.1. Haaee

ace opopa oa-oa (Input-Output SUBroutines), aee - IOSUB, oecea ae oooc opaa aoa ccee "oa" c cooae aap eeoopa - cpoc, xox a opa execx cpec BM "AAT". opopa oo o poe popapoa a acceepe, oea oee aco coex ec.

Ocoe , oee IOSUB, ao:

1. Bo:

- o oooo coa c aap;

- o cpo coo c aap c pacoaae peapx coo;

- e e op oa c cooae popa oa, aao ooaee, .. o c poo cpoca p coe pa pa;

- epeopoa coo a oe (ce oaox o aca pccx acx );

- oee oax coc coo a oe, .e. ceax ec cae oce oo oo coa.

2. Bo:

- o oooo coa a pa oo x ecox peo;

- o c cooae opopa oa coa, aao ooaee, .. o a poe cpoco;

- oee oax coc coo a oe; ca oocc:

   - paee ea p oe,
   - paee oe oa,
   - paee coepaec a pae opae.

Moe oooc IOSUB ceao oope e opopa oca x cooa acceepo popae. He, p oee eao aoce c IOSUB peoaaec apaeoe aoco c x cxo eco, oeae oae po x pao. oo ae a a c accepoa aa IOSUB (poee 1).

7.2. Opaa aoa

opopa IOSUB oecea o c aap epeopo coo: p, ao, ox acoo pccoo aao, pax (c. a poex "Pooc popaca").

p oe aoe coo coec 2 cpaa O.

Boooc oa c paa. a a pao a, oo opee, ao co opae eoopo o paa, a ae eo eoc.

Oo aoa. IOSUB oca eee aoa e a ce oa paa, a opaeo pooo oac, aaeo oo. Oca ac paa p o o e apaa.

Tea o. opaa aoa eeo oe ee o oe. Bo pe oa oa aae, e e ee oepeo co, a o pe oa opeee o pcopa, oo ae oa eoopa aaec oe pcopa.

o pcopa eec p oe aoo coa a, o opaoa ececeoe aoee paa coa cea apao cepx ; p eoxooc pa "caec" epx, ocooa c cpo (ec "oae" epx). e pe epeee pcopa peaoa a oaa apa a pae co p x oe (apep, co "P-Z" ceae pcop a cpo ).

7.3. ocoe apaep aoa

Cocoe aoa ooc opeeec eco apaepa, oope xpac cex eax eo cpa:

1. Ocoe apaep:

TXPAGE (¤A6) - oep aao cpa pao a;

INVFLG (¤32) - cap - pe aoa: (0-C, 1-HC), ocae e cc oo pee C opee eoc coa (aec, coepoe INVFLG acaec o 2- a pecae coa a pae);

WNDLFT (¤20) - e oc oa: paccoe e e pa oa paa aax ( HC o co coo, C - oeoe co);

WNDWDTH (¤21) - pa oa aax;

WNDTOP (¤22) - epx paa oa (paccoe o 0 cpo paa);

WNDBTM (¤23) - paa oa (paccoe o 0 cpo paa);

CH (¤24) - o pcopa cpoe (o eoo pa oa);

CV (¤25) - ea cpoa (epaa o pcopa), ca c 0 o epxe cpo paa;

CSWL,H (¤36-37) - apec ooaeco popa oa coa; IOSUB oe COUT1;

KSWL,H (¤38-39) - apec ooaeco popa oa coa; IOSUB oe KEYIN.

******************************************
*           ^        ^         ^         *
*           !        !         !         *
*    WNDTOP !     CV !         ! WNDBTM  *
*           !        !         !         *
*           v        !         !         *
*         !----------!------!  !         *
*         ! OKHO     !      !  !         *
*         !          !      !  !         *
*         !          v      !  !         *
*         !<---CH--->       !  !         *
*  WNDLFT !                 !  !         *
*<------->!                 !  !         *
*         !<----WNDWDTH---->!  !         *
*         !_________________!  v         *
*                                        *
******************************************

Pc.7.1. aae oa o pcopa.

2. Bcooaee apaep:

BASL,H (¤28-29) - apec aaa ee cpo oa; cec a pa o p cee ae CV; coec oca ecoo oca o pcopa;

RNDL,RNDH (¤4E-4F) - caoe co, eec KEYIN ee a oa oa a;

PROMPT (¤33) - co-paee o o cpo (GETLN).

7.4. Ocae opopa

7.4.1. Beopa pepa

Bxoe o IRQ, NMI, RESET peaae aa ooaecx opopa opao pepa c o cec oaa epexoa o opeo ooaee apec (X+1, X+2). O ece O oca opae.

epexaa IRQ-pepa eoxoo pecope ooe popa, oeo opaaa ocao o oae BRK. Ee apec oe axoc eax ¤FFFE-FFFF coeoo oa . p paoe o opoe OK eoxooc e e, opao pox IRQ-pepa ocaoo opoa eop IRQ.

Cee e , o p eo a ac aec cce oop co coe cceo opao pepa. ca cee ca p popapoa, a cae eoxooc - cooa cce opao pepa.

7.4.2. opopa oa

7.4.2.1. STROBE - o coa e pcopa.

poco opoc cpoa e o aa a. Bee co epeopec TRANSL a pae e oopaaec.

   Bxo: A=co, c.=1,
          Y<¤0B,
          X e eec.

7.4.2.2. KEYIN - caap o coa c ae pcopa.

   Bxo: CURSOR (¤30) - co, aae  aece pcopa.

Bo pe oa oa eaec coepoe ee RNDL RNDH (caoe 16-papoe co), a pae opaec a pcop: epeoae coa ee o c coo ee CURSOR. Kpcop ee o e e, o co. Bee co epeopec TRANSL.

   Bxo: A=co, c.=1.
          Y=CH,
          X e eec.

7.4.2.3. RDKEY - o c (ooo) ecaapo popao.

Ocece epexo o apec, acao (KSWL, KSWH).

   Bxo: a  o opopa (c. ae ocae KEYIN).

RDKEY1: peapeoe aecee "_" CURSOR.

RDKEY2: peapeoe aecee "^" CURSOR.

7.4.2.4. RDCHAR - o coa c pacoaae peapx coo.

Opaec oa o aa oo coa, poe "cpeo" "PE". Bo x coo ee x eee o epe COUT (.e. epeeee pcopa). Haae "PE" ee pcop (o eec c oo RDKEY1 RDKEY2). o po co pepaae a pa e oc.

   Bxo: a  RDKEY.

7.4.3. opopa oa

B ocaex e opopaax pecp X e coec.

7.4.3.1. COUT1 - caap o coa a pa.

   Bxo: A=co.

Ec co e pa, o poco acaec e o pao a, o ceaec. Ec co ee oa ap - ocecee ee ( ocoo, oa coca coa cooec ocae e opopa).

   Bxo: ce pecp coxpac, P acpaac o A.

7.4.3.2. COUT - o coa c (ooo) ecaapo opopao.

Ocece epexo o apec, acao (CSWL, CSWH).

epec o opopa oe a e, a COUT1.

7.4.3.3. PRBYTE - o aa.

   Bxo: A=a.

epea a oc epe COUT a ecaaepoe co (e p).

   Bxo: A e coxpaec.

PRHEX: o ae oo aa a ecaaepo p.

7.4.3.4. CROUT - epeo cpo.

Boc co "p-M" (epeo cpo) epe COUT. aec cpaaae opopaa CR.

CROUT1: peapea oca ocaa ee cpo poea eeo ea.

7.4.4. opopa pae pao

B x opopaax pecp X ae e coec.

7.4.4.1. BS, ADVANCE, UP, LF - c pcopa a o o peeax oa; ec opeec - c epexoo a p cpo, oo paa.

7.4.4.2. CR - epexo aa oo cpo; ec KBD axoc epoa poe - aepa o aa o a.

7.4.4.3. SCROLL - oa paa a cpo epx; epx cpoa p o poaae.

7.4.4.4. HOME - epeeee pcopa e epx o oa epexo a CLREOP.

7.4.4.5. CLREOP - oca (aoee poea eeo ea) paa eo o pcopa.

   CLREOP1: o e, o a xo oac:
        A=cpoa (CV),
        Y=o (CH).

7.4.4.6. CLREOL - oca ocaa cpo.

   CLEOLZ:  o e, o o epeaec  Y.
   CLEOLZ1: ooeo, eoc epeaec  A.

7.4.4.7. DELCHAR, INSCHAR - c ocaa ee cpo eo (pao) c oee eeo (oceeo) coa; oe cpo ( ee o) oec poe eeo ea.

DELCH32, INSCH32, DELCH64, INSCH64: o e aoo peo, pe a xoe:

     Y=o (CH)
     A=eoc (INVFLG).

7.4.4.8. opopa ee ee eoc (e cooece INVFLG):

SETRED, SETGRN, SETYEL, SETBLUE, SETVIOL, SETNAVY, SETWHIT: caoa ooo 7 eo (poe epoo).

SETINV, SETNORM, SETFLASH: caoa oa (epcoo, opaoo, aeo).

SETCOL: caoa ea, epeaoo A.

7.4.4.9. SETTXT - oa pao a ee ecoo pee (opeeec o cape INVFLG).

7.4.4.10. INIT - caoa caapoo oa o ec pa:

WNDTOP = 0, WNDLFT = 0, WNDWDTH = ¤40, WNDBTM = CV + 1 = ¤20.

SETWND: o e, o aee WNDTOP epeaec A.

7.4.4.11. BASCALC - cee apeca aaa cpo, oep oopo epeaec A:

(BASL, BASH) = ao apec + A * 64

7.4.4.12. VTAB - cee apeca aaa cpo oa:

(BASL, BASH) = BASCALC(CV) + CH

VTABZ: o e, o oep cpo epeaec A.

TABV: ooeo, oep cpo aoaec CV.

7.4.5. poe opopa.

7.4.5.1. WAIT - aa eoc 512*A**2 + 27*A/2 + 13 ce. Pecp X,Y e coc; a xoe A=0.

7.4.5.2. BELL - oo ca (oo, 1 , 0.1 ce). Oe pecp Y; X e eec.

        ""