helloworld.ru -  
helloworld.ru -
           
:  

C#
MS Visual C++
Borland C++
C++ Builder
Visual Basic
Quick Basic
Turbo Pascal
Delphi
JavaScript
Java
PHP
Perl
Assembler
AutoLisp
Fortran
Python
1C

-
HTML
VRML
HTTP
CGI
FTP
Proxy
DNS
TCP/IP
Apache

Web-
HTML

VRML
PhotoShop
Cookie
CGI
SSI
CSS
ASP
PHP
Perl


DirectDraw
DirectSound
Direct3D
OpenGL
3D-
DOS





.



MySQL
SQL






demaker.ru

 .




helloworld.ru

Taep

                    1. caoa  ee aepa.

   Bce IBM  PC  co  pocxe  aepa  8253  (  8254)  
coacoa co o  pocxe  ccex  aco.  co  o
ccex  aco  peopaec  o c,  a oceoa- eoc
x co ocaec  opeee pee,    o  o
   oca  a  poooope  oepa    eepa  a
opeeeo aco.  Mpocxea 8253 ee p ex eacx
aaa, a  oopx oe popapoac.
   Mpocxea 8253  paoae  eaco   o   poeccopa.   poeccop
popape  pocxe    ae  opaaec   p ea.  Ta
opao 8253 ece a ac peaoo pee -  oa  cae  co
c  eaco  o  oo,  o  pocxo  oepe.  Oao,
aca popape epa  cocae  peo  1/12
ce.  ocea epao pee  ac    ae-o
pe cpeca.  eo o o pe c  o  eoo  aaa
pocxe  aepa  aaac  epeeo,  axoec  oac
ax BIOS.  o poecc oa- a a pc. 2-1. o aoee oo
aaec oceo pe- e co.  18.2 paa  ce xo aaa
0 opaaaec aapa pepae (pepae aepa),  oopoe
eaoo  ocaaae poeccop  eae ce pee co.
co 0 cooece oo 12:00;  oa ce ocae  ae
aeoo  24  aca,  o  cpacaec  a  o.  poe pe 
eee co eo opeeec eee oaae cea  a  18.2
 ao ce.  Ce pee co c- oec  oce
oepa, cax co peee.

           2. popapoae pocxe aepa 8253/8254.

   Ka  pex aao pocxe aepa 8253 (8254  AT) coco
   pex   pecpo.   oc    ao  pe    pex  pecpo
ocecec  epe  o  op;  oepa  opo  o   40H   o   42H
cooec   aaa  0  -  2.  op  ca  c  8-  pecpo
oa/oa,  oop ocae  pae ae  oo aa-  a.
Koa aa apopapoa, o epe o op ocaec xaoe
aee,  a a  caaa.  o  co  epeaec    16-
pecp  a  (latch  register),  oop  xpa  o  co  
oopoo o oeaec   16-  pecp  cea.  B  pecpe
cea  co  eaec  a  e a pa,  oa c o
ccex aco pocaec epe aa.  Koa aee  oo  ca
ocae  ,  o  aa  ae xoo ca  ae oa o
coepoo pecpa a epeaec  pecp  cea,  oce
eo  poecc  oopec.  e ee co  pecpe cea,  e
cpee p.  Bce p aa- a cea a: poeccop e ae 
e  ae  x.  Teee aee oo  pecpo cea oe
 poao  o oe pee, e  a ce.
   Ka aa ee e xoe  o xo . Bxoa 
o c,  oae  peae ocea. Haa- ee x
cao appec  acoc o a IBM PC:
   Kaa 0 coec  cce  aca  pee  co.  O  ca-
aaec BIOS p cape a opao,  o ae c p-
eo 18.2 paa  ce. 4-a ce x co xpac
  a o apec 0040:006C (a a xpa- c ep).  Ka
c  pe  pepae  aepa  (o-  ep  8)    eo  o
pepae  eae oaae cea.  o aapaoe pepae,
oo oo  opaaaec  cea,  eaco  o  oo,  e  a

                                     - 2 -
poeccop,  ec oo papee aapae pepa (c. ocee
  [1.2.2]).  Bxoa    coec  ae     cxpoa
eoopx cox oepa,  oo ec B e ee aee,  o
Ba eoxoo occao-  epoaaoe aee epe  opaee
 c.
   Kaa 1  pae  ooee a oo eo e e poa.
Bxoa  oo aaacaa  c  pocxeo  poo  oca  
a    ee  c  acae  pocxe DMA oo c a.
Kaa 1  coec    ocea  aopoax  co  aco
pee co,  c e o oo o oo aee cea oce
aepe cox oepa.
   Kaa 2  ca  c  poooopee  oepa    o  poo
poce pooe c  eepa a.  popac e
o opo a op aao,  e a oca. poce 
o eeppoac oopeeo c p popa oepa,  a
oee  coe  oe  e  o     oc   a   ce
cooa   poeccopa.   Kaa   2   oe      ocoee  o
poooope    cooac    cxpoa-   .   Haoe,
xoa  aaa 2 caa c ao oepa.  Oao a
e e eeppoa  o ex  op  oa  e  cea  opeeee
cao pocxe epeca c epe- pe 8255.
   e xoe   aoo aaa coco   aco, oopa
epeae  ca  o  pocxe  ccex  aco  ,  aaeo
opoa (gate),  oopa ae  ae ca o aco.  Bopoa
cea  op  cao aco o aaa 0  1.  Ho o o 
ap  aaa 2, o ooe eo- ope ceae a-
  co  o.  Bopoa apac ca- oo aeo a opa c
apeco 61H,  oop ec pe- cpo pocxe 8255; cpoc oo
a  coa  opae  opoa.  a  pocxea ocaec  [1.1.1].
Oe o - a  xo aaa 2 -  1 opa 61H ca c ao
  ae  oe  c-  ooac    eepa  a.  Ha pc.  2-2
peea apaa pocxe aepa 8253.
   Mpocxea aepa    oe   cooac   eocpeceo   
peex  oepa,  o  o  peo  ae  o.  Bo  c   aco
pooc 1.19318 oo pa  ce (ae a AT, e ccee
ac  cpee,  pocxea aepa oae ca c acoo  1.19
M). oco acaoe co, oopoe oe xpac  16 ax,
pao 65535  oco o  co  ec  a  aco  co  o
aco, pa 18.2, o aca oo epa e ca
pae  peo  1/12  ce.  oo  oco   peex
oepa  co  ce pee co BIOS.   ocea pee
aec aee pee-  co    cpaaec  c  eoop  paee
aoe aee  opeee ca co, poex c oo
oea.  Ce- a coco ooe  cooa  ce  pee
co  oepa  peao pee.
   8253 peocae papaoa oopoa 6 peo  pao  
aoo aaa. popac oo opaac pe peo, a
 aaa 0 p cxpoa,  a   aaa 2    cxpoa
  eepa  a.  B  o  pee,  a  oo  pecp a
oae co, o eeeo apae o  pecp cea. Koa
aee    cee  ocae    pe-  cp  a  oeo
epeapae ce  ..  B eee oo ocea xoa 
ea,  a    eee oo - ea.  B peae oac
pooe o,  oope  oaoo  po  a    eepa
a, a   ocea.
   8- oa  pecp  pae  cocoo  ap  ce  
aa.  Apec opa  oo pecpa pae 43H. Koao pe- cp
epeaec a, oop oop ao aa popapo- a,  ao
pee,  a  ae  o    oa  aa  pecpa a o 

                                     - 3 -
epea.  O oaae ae  e    co    oo    BCD
(ooopoao  eco) ope.  aee o oo pecpa
aoo:
      0    ec 0, oe ae, ae BCD
       3-1    oep pea, 1 - 5 (000 - 101)
       5-4     oepa:
                00 = epea aee cea  a
                01 = a/ca oo cap a
                10 = a/ca oo a a
                11 = a/ca cap a, oo a
       7-6    oep popapeoo aaa, 0 - 2 (00 -10)

    popapoa pocxe 8253  ao  o  p  ocox
aa.  oce  oo  a pe a aepe,  apopapoa aa
eeeo aae opoa o oo popae.
   1. oca    oa pecp (43H) a,  peca eo
o,  oope pa aa,  cac e/ac, pe oepa 
op pecae ce.
   2.  aaa 2 ao pape ca o aco,  cao  1  0
opa  c  apeco 61H.  (Koa  1 oo pecpa caoe  1,  o
aa  2  pae  ao.  Cpoce  eo    0    oepa-   
cxpoa.)
   3. Bce aee cea o 0 o 65535,  oece eo  AX, 
oe  caaa  a,  a ae cap a  pecp oa/oa
aaa (40H - 42H).
   Kaa pocxe  8253  paoa cea.  o o pe popa
cea o occaaa aae cao pecpo 8253  epe
aepee.  B  acoc,  ec p aepe popa eeppec
,  o o e pooac ae oce oo,  a  MS  DOS  o
paee  ap p popa.  ee o  p aca
poep xoa o Ctrl-Break [3.2.8].

   H poe.

   B ao pepe aa 0 popapec  a  poe  aee,  e
caoeo BIOS p cape. pa ee cao coco  o,
o e epa ee cea  pee  co  a  o
e,   e  18.2  paa    ce.  acoa  ooe  cea
eec,  cae,  a 1000 pa  ce,  c e poee ox
aopaopx  epe.  aee  a  oo  1193 (1193180
ao   ce  /  10000).  Ka  a  eee  aee  pecpa
cea c.  pepe [2.1.8]. epe co oepa opaoe
aee a oo  occaoeo,  oco aa 0 co-
ec    cxpoa  cox  oepa.  Macao  oooe
aee - 65535 ao aco e ca o aaa -  oe  
oco  aco  0  pecp a (0 eeeo pepaaec 
65535 p ee a e.
;---caoa pecpo  oa/oa
             COMMAND_REG EQU 43H   ;apec oaoo pecpa
             CHANNEL_0 EQU 40H     ;apec aaa 0
             MOV   AL,00110110B   ;caoa o  aaa 2
             OUT   COMMAND_REG,AL ;aca  oa pecp
;---oca cea  a
             MOV   AX,1193     ;ce  100 co/ce.
             OUT   CHANNEL_2,AL   ;oca aeo aa
             MOV   AL,AH       ;oo  oc cap a
             OUT   CHANNEL_2,AL   ;oca capeo aa

                     3. caoa/ee pee.

                                     - 4 -

   p cape  MS  DOS  apaae    ooae   eee   pe.
Beeoe aee oeaec  4 aa, xpae ce pee co
(aa c 0040:006C,  a a xpac ep).  Ho  caaa  oo
peopaec  op,  oopo ocaec pe co, .e. pe
peopaec   co  oceaax  oe  ce-  ,  poex  c
oo. o co ocoo ooec 18.2 pa  ce pepae
aepa.  Koa  oec  oepeo  apoc  a  pe,  o  eee
aee  cea  pee  co  peopaec  opao   p
opa ac--ce.  Ec p cape e o eeo  ae,
o ce caaaec  o, a o ceac oo. Koep
caee    pocxeo    aeap-aco    o     aoaec
caaa ce pee co.

   Cpe poe.

   MS DOS  peocae  pepa   e  cao pee- ,
poo eoxoe peopaoa e aee  cea  pee
co  aca-a-cea.  Bpe aec c ooc o 1/100
ce,  o oco ce pee co ooec c  acoo  
 pa ee, o oaa cox ce-  oe pee. -
 2CH pepa 21H ae pe, a  2DH - caaae eo.
B  oox  cax  CH  coep  ac (o 0 o 23,  e 0 cooece
oo),  CL -  (o 0 o 59),  DH - ce (o 0 o 59)  DL  -
coe o ce (o 0 o 99).
   Kpoe oo p oe pee e 2CH, AL coep oep 
ee  (0  = ocpecee).  aee  e ep oo ec a
caoea aa.  DOS ce oep    ee  o  ae.  Oe
ae, o p caoe pee e 2DH, AL oeae paoc
eeoo ae pee (0 = pa- o, FF = epao).

;---caoa pee
   MOV   CH,HOURS       ;o ae pee
   MOV   CL,MINUTES     ;
   MOV   DH,SECONDS     ;
   MOV   DL,HUNDREDTHS  ;
   MOV   AH,2DH         ;oep  cao pee
   INT   21H            ;caaae pe
   CMP   AH,0FFH        ;poepe paoc ae
   JE    ERROR          ;epexo a opao o

;---oee pee
   MOV   AH,2CH         ;oep  oe pee
   INT   21H            ;oae pe
   MOV   DAY_OF_WEEK,AH ;oae e ee  AH

   H poe.

   Ec B  e  copoc  co  aaa 1 pocxe 8253 
ceax poe,  o Ba eoxoo aca  co  po-  ep
eopoa oaa cea pee co. BIOS ooe aao
ae cea o 0 o 1.573 oa    o  oe    eeo
oo  e  ee  pepa  aepa.  oo  ac,  peao
oaae  coe  o  ce,  e  o  paoa  24  aca  e
ceao  acao  popa.  Oe  ae,  o a 0040:0070
caaaec  o p cape,  a  ae  eaec  a  1  (e
oe) o xo aco.

                       4. caoa/ee a.

                                     - 5 -

   p e  oepa  MS DOS apaae  ooae ee
a  pe.  Bpe  acaec    oac  ax  BIOS.  aa  e
coepc    epeeo    COMMAND.COM.  Oa xpac  opae pex
oceoaex ao,  oope coepa cooeceo e  eca,
oep eca  oep oa,  aa c 0, e 0 cooece 1980 o.
B o o cea pee co,  apec a   a  eec  c
eee  epc  DOS    ooee    a COMMAND.COM.  o o
pe  oe a cea  ao  cooa  ooe  
eca  MS DOS, a e opa- ac  o epeeo ap.
   Ma,  oopoae pocxeo aeap-aco,  aoa-
ec caaa pe  a  c oo ceao popa
(oo  acaeo  p cape epe a  AUTOEXEC.BAT).   Ka
o oc  pocxee aeap-aco,  c. [2.1.4]. Oe-
  ae, o oa ce pee co BIOS epexo  epe
oe 24 aco, MS DOS ee a.

   Cpe poe.

    2AH  2BH pepa 21H oa  caaa a.  
oe a oece    AH  2AH    oe  pepa-  e.  p
opae  CX  e  coepa  o    e  ca  o  0 o 119,  o
cooece aao e 1980 - 2099  (oo  caa  o  aec
ceee ooceo 1980 .). DH coep oep eca, a DL - e.

   MOV   AH,2AH       ;oep  oe a
   INT   21H          ;oee a
   MOV   DAY,DL       ;e  DL
   MOV   MONTH,DH     ;ec  DH
   ADD   CX,1980      ;oae a  o
   MOV   YEAR,CX      ;oae oep oa

    cao a oece e, ec  o  e e pec-
p   oe  2BH.  Ec ae, aae    a
eep, o  AL e opaeo FF,  poo cae - 0.
   MOV   DL,DAY       ;oeae e  DL
   MOV   DH,MONTH     ;oeae ec  DH
   MOV   CX,YEAR      ;oeae o  CX
   SUB   CX,1980      ;epe ceee ooceo 1980
   MOV   AH,2BH       ;oep  cao a
   INT   21H          ;caoa a
   CMP   AH,0FFH      ;poepe ceoc oepa
   JE    ERROR        ;eepa aa, e a opao o

             5. caoa/ee aco peaoo pee.

   ac peaoo pee e co coce poeccop,  oo-  p
oe  oca  pe  e  a pe oepe oe- pa.
O e ae eac co a, coe oa o-
ep  e.  popao oo a a,  a  caaa ac
peoo   pee.   Oo   eec    ooeoe    popaoe
oeceee,  oopoe  caaae  ce  pee-    co BIOS 
epee a DOS a opao,  o o  cooecoa  e
oaa  aco  peaoo  pee.  Ho  oo  popao poep
cooece e   p oape paoac p eoxo-
e ep.
   Pae cao  pee    a  ocecc  epe   aop
apeco opo.  Moe oooae a pacpe  IBM PC
e  ac  peaoo  pee,  o,    coae,  e   caapo

                                     - 6 -
pocxe  aaoa apeco opo.  AT oopec aca peaoo
pee,  ocoa a pocxee MC146818  p  Motorola,  oope
co  e  e  pecp,  o  poc- xea,  coepaa ae o
opa cce.  oc   pecpa oo  o,  oca
caaa oep peeoo pecpa  op 70H, a ae poa aee
pecpa epe op 71H. Pecp, cae c aca, cee:

           Hoep pecpa              

                00H                  Ce
                01H                  Cea peoa
                02H                  M
                03H                  Ma peoa
                04H                  ac
                05H                  acoa peoa
                06H                  e ee
                07H                  e eca
                08H                  Mec
                09H                  o
                0AH                  pecp caca A
                0BH                  pecp caca B
                0CH                  pecp caca C
                0DH                  pecp caca D

    epex  cacx  pecpo  o pae ,  
oopx epec  popaco o peca cee:
   Pecp A:  7   1 = e oa pee (ao a
                          ae 0, o a)
   Pecp B:  6   1 = papeeo epoecoe pepae
               5   1 = papeeo pepae peo
               4   1 = papeeo pepae oa oa
               1   1 = ac cac o 24, 0 = o 12
               0   1 = papeeo aoae pee co
   ac peaoo pee a AT o  a  aapaoe  pepae
IRQ8.  popaa  oe  cao  eop  oo  pepa a 
poep,  oop peec o  opeeeoe pe pepae
oe ac o  pex cocoo, a  oopx apee p
cape.  epoecoe   pepae   pocxo   epe   opeeee
epa pee.  epooc peo paa oo cee.
pepae peo pocxo oa aee pex pe-  cpo  peo
coaae co ae cooecx peex pecpo. pepae
oa  oa  pocxo  oce   aoo   ooe   ae
pecpo pocxe.
   pepae 1AH pacpeo  BIOS AT,  o oo  ooo  a  
caaa  ac  peaoo pee.  oco oaa oa e
coco oee e x x ecx p, o ae pee ac
  oo-opoao  eco ope (BCD),  oa a ec a
e oo  aa eca pa pecaec ep  a.
Tao opa ooe eo epeo ca  op ASCII.  popae
o oo  c  oo  aa    a  oe  pecpa  
oa 48  oe-  oa ASCII, cooeceo ao c.
 cex IBM PC  0  1 pepa  1AH  a    caaa
ce  pe-  e co BIOS.   aco peaoo pee AT eec
ec ox :

    2:  ee pee  aco peaoo pee
               p opae: CH = ac  BCD
                             CL =   BCD
                             DH = ce  BCD

                                     - 7 -
    3:  caoa pee aco peaoo pee
               p xoe: CH = ac  BCD
                          CL =   BCD
                          DH = ce  BCD
                          DL = if daylight savings, else 1
    4:  ee a  aco peaoo pee
               p opae: CH = e  BCD (19  20)
                             CL = o  BCD (c 1980)
                             DH = ec  BCD
                             DL = e eca  BCD
    5:  caoa a aco peaoo pee
               p xoe:    CH = e  BCD (19  20)
                             CL = o  BCD (c 1980)
                             DH = ec  BCD
                             DL = e eca  BCD
    6:  caoa peo  aco peaoo pee
               p xoe: CH = ac  BCD
                          CL =   BCD
                          DH = ce  BCD
    7:  Cpoc peo (e xox pecpo)

Tpeoa caaaec  a ceee,  ooceo eeo o- ea
pee. Maca epo pae 23:59:59. Ka e oo- poc e,
eop  pepa 4AH oe aa a poep opao peo.
Oe, o ec ac e paoa (aoee epoo, -a occ
a), o oee  2, 4  6 caaae a epeoca.

                   6. aepa popax oepa.

   Ec B  ocecee  aep    popae  ocpeco  coo
a,  o Ba  oe  opeoac  oo  pee    oo,  o
oc oo pee aep.  ae ec B opeee pe- e
eoc, o e  epe, o Baa popaa e aa
oe  pe  aep  p  cex  cox.  eoc a oe
ec  acoc o coeoo oopa (,   eca,
o  oo,  opec  popaa    e).  A  ae pe,  oa
eec oo aop a coecx c  IBM  PC  -  ex  po
aao  copoc  poeccopa  -  ae   a e acceepa oe
po  pa pee- a aep.  oo pao  opee
pe popao a- ep eocpeceo o aca.  acoa ocea
18.2 paa  ce,  coea    oa  cea  pee
co, oa oe oeop oco opeoce (a e-
 aco oceo.
   o oece aep ao pooeoc, popaa oa
oca  peeoe  co  co  cea  pee  co.  o
aee  oaec    cao ee ae cea.  ae
popaa ocoo cae aee  cea    cpaae  eo  c
aoe.  Koa ocaec paeco, o peea aepa poa
 oo  pooa  oee  popa.  epe  aa,    oopx
xpac  aee  cea  pee co xpac,  aa c apeca
0040:006C (a oo,  aa c aeo aa).  aepe ex
14  ce oo ooac oo a ao.  a ax aa
oo aep o ooo aca (oee,  a o-ce ee,  e
ac).

   Cpe poe.

   poae aee cea pee co BIOS, co  0
pepa 1AH  oae  e eoxooe co  co  o  1/18

                                     - 8 -
ce.  oce  oo  cae  ee ae-  cea pee
co,  ocoo  cpaa  c  peeo  eo.  p  oce
paeca ao oa aep.  pepae 1AH opaae a ax
aa  DX (oco  aepe  a-  ac    x  peeax),
oo a capx aa,  opaae- e  CX,  o oppoac,
o  oo  Ba  ea  32-ax  oepa.  B  ao  pepe
caoea aepa a 5 ce, o cooece 91 oce.

;---oee ae cea  caoa aep
            MOV   AH,0   ;oep   "e"
            INT   1AH    ;oae aee cea
            ADD   DX,91  ;oae 5 ce.  ae co
            MOV   BX,DX  ;aoae peeoe aee  BX
;---ocoa poepa ae cea pee co BIOS
REPEAT:     INT   1AH    ;oae aee cea
            CMP   DX,BX  ;cpaae c co
            JNE   REPEAT ;ec epae, o oope coa
                         ;ae, aepa ooea

AT ee  oao     pepa   15H,   oopa   ooe
ocec  aep a aaoe pe.  oece 86H  AH,  a co
poce aep  CX:DX. oce oo oe pepae.

              7. Oepa apopapoae o pee.

   popaa opeee pe  oe opeeeo oepa-   
ooc  a e,  a  eoe:  epec aaoe oaae cea
pee co  ae cpaaec c oce oa- a.  Moo
oa  ae   opae ac--ce,  o co xooo
c pa e a oaa,  oco ccea cea e
eca.  e  po  a ce pee co BIOS,  ep
pooeoc  1/18 ce,  a ae e epeo ee   o
opa ::cc.

   Cpe poe.

   pepae 1AH  ee e   cao (AH = 1)  oe
(AH = 0) cea  pee  co.    e  cea  ao  poco
o   pepae  c  AH  =  0.  p  opae  aee  cea
coepc  CX:DX,  pe aee coo  CX.  AL coep-  0,  ec
ce  e  epexo  epe  pa  24  aco  c  oea ocee
cao.  cao cea oece a coa  e e pecp,
a    AH  -  1.  B  peeo pepe epc poe pee 
peeax aca.  p o  oo a ax aa cea.  Ho 
o  cae eoxoo poep,  o e o epexoa epe pa,
oa aaoe aee o oe,  e  ceee.  ;---  ceee
ax  OLDCOUNT  DW 0 ;xpa aaoe aee cea ;---oae
aaoe aee cea
          MOV  AH,0        ;oep 
          INT  1AH         ;oae aee cea
          MOV  OLDCOUNT,DX ;coxpae aaoe aee
           .
   (ec e poecc, eoc oopoo epec)
           .
;---oee ce eoc poecca
          MOV  AH,0        ;oep 
          INT  1AH         ;oae aee cea
          MOV  BX,OLDCOUNT ;cae capoe aee
          CMP  BX,DX       ;poepe a epeoee

                                     - 9 -
          JG   ADJUST      ;opaoa epeoe
          SUB  DX,BX       ;ae epe paoc
          JMP  SHORT FIGURE_TIME  ; epeo ee  o 
;---opaoa epeoe
ADJUST:   MOV  CX,0FFFFH   ;oeae  CX acaoe co
          SUB  CX,BX       ;ae epoe aee
          ADD  CX,DX       ;oae opoe aee
          MOV  DX,CX       ;pea xpa  DX
;---poepa epeoa pee  o opa
FIGURE_TIME:               ;e a 18.2 ce  ..

               8. paee paoo  peao pee.

   p oepax    peao  pee popaa oe cp 
aa oe pee,  a e p  epo  oooc.  Taoo  poa
oepa  oo  accopc  c  pooexo,  o eec oeco
px  poe.  eec  op  oxoa    oepa    peao
pee.    popa,  oope  e o eo ea  poee
e  cp,  pe  peeo  p,   oo   poco
epoec   poep  ce  pee  co,  oa  ace
oo oea.  Tao oxo paec  coc    aop  cx
o, ocax  [2.1.5].
   Bopo oxo  oee  coe.  O  coec,   oa   popaa
ocoo  aa  ao-o  paoo,  o  oa  oa  opeeee
oe pee pepa co  oepa    oe  opeeeo
aa. B o cae pacp pepae aepa, oopoe oec
18.2 paa  ce.  Koa o pepae  pocxo,  ooe
o  poepe  ooe  aee  cea pee co  ec ac
opeee oe pee,  acae  poep.  o poecc
oaa a pc.  2-3. peee ec poce pep oaa, a
coa     coe   popae   ,   oop   caaaec
ooaee  oae o- o ca,  oa ooo pe.  (oee
co pep oo po  [2.2.6] coe ,    o  pe
oa poeccop a p ea.)

   H poe.

   BIOS coep ceaoe coe pepae (1CH), oopoe eo e
eae, oa B e ae  eo poep. p cape eop oo
pepa  aae  a cp IRET (opa  pepa);  p
eo oe pocxo oea opa. Ho pepae 1CH epeco
e,  o  oo aec pepae aepa BIOS oce oo,  a o
pepae ooo aee cea pee co. Moo caa, o
o  aapaoe  pepae,  pocxoee  aoaec  18.2  paa 
ce.  B oee e eop  oo  pepa  a,  o  o
aa  a  poep   Bae popae.  oce oo Baa poepa
e ac 18.2 paa  ce.
   Hacaa Ba   poepa  oa  poa  oo  o  o-
poaoe aee cea pee co,  cpa eo  c  oae
peee,   o o o peec,  oa oaeoe pe aoe
ac.  Ececeo,  o oa pe ee e o- oo, o poepa
poco  opaae  paee,  eo  e  e-  a.  Ta  opao,
poeccop e oe e pao.
   B peeo  pepe poepa (e oaaa ec) apaae 
ooae co  (o 60),  oopoe oo po o  oo,  a
paacc   oo   a.   o  co,  aaceoe    MINUTES,
oaec  a  1092    epeoa    aeoe  co  co
cea  pee co.   epoa  peeax ooo aca ocaoo
16   -  oee  e  epo  pe  oee  cox  32-ox

                                     - 10 -
oepa.  o  co  co  oaec  ae co eeo
ae cea pee co  aoaec  ALARMCOUNT.
   ae eop  pepa  1CH  eec  a  opao,  o o
aa a poep ALARM.  oe,  o  a  oo  eop  e
ee,  ALARM e aoaec ac 18.2 paa  ce. p
oe a poepa ae eee  aee  cea  pee  co
epe  pepae  1AH   cpaae c ALARMCOUNT.  p coae x
e aec poepa BEEP (ae e oa- aa ec, oopa
ae oo ca.  B poo cae pocxo opa. O
o opaa    aapax  pepa  (MOV  AH,20H  /  OUT  20H,AL)
a  poe- p e o, a a o e  pepa aepa.
e ae  e ae coxpa eee pecp.

;--- ceee ax
   MINUTES     DW    0     ;xpa co  o oa
   ALARMCOUNT  DW    0     ;xpa ce pee  oa

;---caoa oaeoo ae cea pee co
   CALL  REQUEST_MINUTES   ;apoc ca  o oa
   MOV   AX,MINUTES        ;epeca  AX
   MOV   BX,1092           ;co co cea  e
   MUL   BX                ;oae - pea  AX
   ;oae eee aee cea
   MOV   AH,0              ;oep  e cea
   INT   1AH               ;ae aee, a a  DX
   ;caae oa ae
   ADD   AX,DX             ;
   MOV   ALARMCOUNT,AX     ;oae oe aee cea
;---aee eop coo pepa
   PUSH  DS                ;coxpae cee ax
   MOV   AX,SEG ALARM      ;epe cee poep ALARM
   MOV   DS,AX             ;oeae eo  DS
   MOV   DX,OFFSET ALARM   ;epe ceee poep
   MOV   AL,1CH            ;oep eeoo eopa
   MOV   AH,25H            ; ee eopa
   INT   21H               ;ee eop
   POP   DS                ;occaaae cee ax
;
;---ae pooaec popaa
;
;--- oe popa opaae eop pepa
   MOV   DX,0FF53H         ;opae ae 
   MOV   AX,0F000H         ;pepa 1CH
   MOV   DS,AX             ;oeae cee  DS
   MOV   AL,1CH            ;oep eeoo eopa
   MOV   AH,25H            ;oep 
   INT   21H               ;occaaae eop

;---poepa a ooo caa
ALARM    PROC FAR          ;coae  poep
         PUSH AX           ;coxpae eee pecp
         PUSH CX           ;
         PUSH DX           ;
;---ae ce pee co
         MOV  AH,0         ;oep  e cea
         INT  1AH          ;ae aee cea
;---cpaae c pee aee
         MOV  CX,ALARMCOUNT   ;epe peeoe aee
         CMP  DX,CX        ;cpaae c e

                                     - 11 -
         JNE  NOT_YET      ;ec epa, o a xo
;---ae oo ca, ec ae coa
         CALL BEEP         ;a poepa e oaaa
;---ae opaaec  pepa
NOT_YET: POP  DX           ;occaaae pecp
         POP  CX           ;
         POP  AX           ;
         IRET              ;opa  pepa
ALARM    ENDP              ;oe poep
[ | | ]










helloworld.ru © 2001-2018
Rambler's Top100 TopList