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

             1.   

            -
          -
   .      -
   ,     ""
    0     0.   
  :          -
   4-.
     ""       ( -
 ),        -
 .       2--
 ,   ,       -
.
                
 ,    DEBUG.  -
  D     :  D 0:0.   DEBUG
   128   32 ,      
 :

     0000:0000  E8 4E 9A 01 00 00 00 00-C3 E2 00 F0 00 00 00 00
     0000:0010  F0 01 70 00 54 FF 00 F0-05 18 00 F0 05 18 00 F0
     0000:0020  2C 08 51 17 D0 0A 51 17-AD 08 54 08 E8 05 01 2F
     0000:0030  FA 05 01 2F 05 18 00 F0-57 EF 00 F0 F0 01 70 00
     0000:0040  90 13 C7 13 4D F8 00 F0-41 F8 00 F0 3E 0A 51 17
     0000:0050  5C 00 B7 25 59 F8 00 F0-E2 0A 51 17 9C 00 B7 25
     0000:0060  00 00 00 F6 8E 00 DE 09-6E FE 00 F0 F2 00 7B 09
     0000:0070  27 08 51 17 A4 F0 00 F0-22 05 00 00 00 00 00 F0

        " ":   ,   
. ,   ,   DEBUG -
  (E8 4E 9A 01)          
019A:4EE8.
              .    
 ,   ROM-BIOS,    
  F,     .  
    ,        (  
: 019A:4EE8).        
   (,  SideKick  Prokey),   -
     DEBUG ( DEBUG   
 ). ,      ,
           .
       ,      (
   1)       .
   pepa o ooe poep,  oope  oep  ae  
oe  opeeeo  aa.  Cec  aapae  popae
pepa.  Aapae pepa  pc  aapapo,  o  c
cceo  a,  o  c  ap  pacpe.  O  o  a
cao pocxe aepa,  cao o pepa, aae a a
aape  oeco px p. Aapae pepa e oop-
pc  c  paoo   popaoo   oecee.   Koa   aec
pepae, o poeccop ocae co pao, oe pepae, a
ae opaaec a peee eco.   oo o e  oooc
epc  oo    oe eco popa,  apec oo eca (CS:IP)
aoaec a  cee,  ece  c  pecpo  ao.  ae    CS:IP
apaec  apec  popa  opao  pepa    e  epeaec

                                     - 2 -
paee.  popa opao pepa oa aa  paepa
pepa.   O  cea  aepac  cpe  IRET  (opa  
pepa),  oopa aepae poecc, aa pepae, opaa
cape  ae  CS:IP    pecpa ao,  e ca aa popae
oooc poo oee  oo e coco.
   C po  copo,  popae  pepa  a cao ee eo e
pepa.  Ha cao ee o  oe  poep,  oope  ac
Ba  popaa    oe  po pao,  ao a pe
aa  a  a  aape    o  a  pa.   Oao   
opopa  coepac  e  p Bae popa,  a  oepaoo
ccee  exa pepa ae Ba oooc  opac    .
popae  pepa o ac p  pa.  Hapep,  ce
pepa opao  oa  c  aap  DOS  co  pepa
opao  oa  c  aap  BIOS    oe coa  epa
aap.  apaoe  pepaee  oe  o  paee   p
oe  popaoo pepa.  p o e oae oo,
a a aa opopaa  opao  pepa  coxpae  ae
cex  coex  e pecpo  ae occaaae x p xoe,
e ca e oca ceo oo, o oa aaa poeccop.
   Apeca popa  pepa aa eopa.  Ka eop ee
 epe aa.  B epo coe xpac aee IP, a o opo -
CS.  Mae  1024  a  a  coepa  eopa pep a,  a
opao eec eco  256 eopo.  Bece  e o  aac
ae   eopo.  Beop    pepa  0  aaec  c  e
0000:0000,  pepa 1 - c 0000:0004,  2 - c 0000:0008    ..  Ec
ocope  a  epe  aa,  aa c ape ca 0000:0020,   oopx
coepc eop pepa 8H (pepa  e  pee  co),  o  B
oape a A5FE00F0.  e , o a a coa pacooe
caaa  o opo  IP:CS,  o  4-aoe  aee  epeoc  
F000:FEA5.  o  capo apec popa ,  oe pepae
8H. Ha pc. 1-2 oa aa cxea oe popao pepa 21H.

           2. popapoae opoepa pepa 8259.

    pae aapa pepa o cex ax IBM PC co-
ec  pocxea  popapeoo opoepa pepa Intel 8259.
oco  a oe pee  oe  oc  e  o  apoc,
pocxea  ee  cxe  popeo.  eec 8 po e popeo,
poe AT,   oopoo x 16,   opae   coo  ec  po
ooaac  copae  o  IRQ0  o  IRQ7 (o IRQ0 o IRQ15),  o
oaae apoc a  pepae.  Maca  pope  cooece
po 0. oaoe 8 poe  AT opaaac opo pocxeo
8259;  o opo aop poe ee pope  e  IRQ2    IRQ3.
apoc  a  pepae  0-7 cooec eopa pepa o 8H o
0FH;   AT apoc a pepa 8-15 ocac eopa o  70H
o 77H. He p ee aae x pepa:

   Aapae pepa  ope popea.

   IRQ 0     aep
       1     aapa
       2     aa oa/oa
          8  ac peaoo pee (oo AT)
          9  popao epeoc  IRQ2 (oo AT)
         10  peep
         11  peep
         12  peep
         13  a. copoeccop (oo AT)
         14  opoep cpoaoo ca (oo AT)

                                     - 3 -
         15  peep
       3     COM1 (COM2  AT)
       4     COM2 (oe  PCjr, COM1  AT)
       5     cpoa c (LPT2  AT)
       6     opoep ce
       7     LPT1

   pepa pee co a aca pope,  oco ec
oo  e  ocoo epc,  o  eep oaa ccex
aco.  pepae o aap  aec p aa  oca
a;  oo ae e co,  oopa oo aaaec e,
o o a oe- aec  ep aap (oa o ae  oe
 oe popa pepa).
   Mpocxea 8259 ee p ooax  pecpa,  oope  pa
oce    aapax pepa.  Pecp apoca a pepae
(IRR)  caaae  cooec  ,  oa      pepa
cape  o  apoce.  ae pocxea aoaec poepe e
opaaaec    poe  pepae.  p   o   oa   apaae
opa  pecpa oca (ISR).  ooe a e oeae
a cxe popeo.  Haoe,  epe oo pepa,  poepec
pecp  ac  pepa  (IMR),  o  a papeeo   a
oe pepae aoo po.  Ka pao popac  opaac
oo    pecp  ac  pe  pa  epe  op  21H  oao
pecp pepa epe op 20H.

         3. ape/papeee oex aapax pepa.

   popa a  aaceepe  o  ape  aapae   pepa,
epecee  .  o  acpee  pepa;  pe  aa-  pae
pepa,  oae p eoopx oax (ax  a  eee  a
o)  e  o    acpoa.  ec  e  p  apea
aapax pepa. B epo cae ce pepa opc c e
o peca ac oa a oea eo,  pee e aa
poee aoe-o poe ece.  Hapep,  pepa apea
p   ee  eopa  aapaoo  pepa,  ea  oe
pepa oa eop ee oo aoo.
   Bo opo   cae   acpc   oo   opeeee  aapae
pepa.  o eaec oa eoope opeeee pepa o
aoecoa c oepa,  p  peea. Hapep, oo
paccaa o pee poepa oa/oa e oe cee  oo
 pepao e co pepa- e.

   H poe.

   Boee pepa ac o ae aa pepa ( 9) 
pecpe ao.  Koa o  pae 0,  o papee ce pepa,
oope papeae aca. Koa o pae 1, o ce aapae pepa
apee. o ape pepa, cao o a  1, co-
ec  cp  CLI.    oc  oo  aa    occaoe
pepa - cp  STI.  e-  ae  oe  pepa  a
e  epo.  pepae  pee  co  pocxo 18.2 paa 
ce  ec  o pe- pa  oee  e  o  apoc    o
pe,  oa  aapae pepa  apee,  o e apoc
 opoe  cceoe pe e opeec epao.
   aa aoaec  apeae  aapae  pepa  p  oe
popax pepa  aoaec papeae x p opae. Koa
B ee co popae pe- pa,  o B oee aa popa
c cp STI,  ec  B  oee  oc  aapae  pepa.
Oe  ae,  o  ec  a  cpe CLI e cee STI,  o o

                                     - 4 -
pee  ocaoe a, a a o c aap e aopoe.
    acpoa opeeex  aapax  pepa  o  poco
oca   pee  eo  o    op  c  apeco  21H,  oop
cooece pecp ac pepa (IMR).  Pecp ac a opo
pocxee  8259  AT (IRQ8-15) ee apec opa A1H.  caoe e
 pecpa,  oope cooec oepa  pepa,  oope  B
xoe    acpoa.    o   pecp   oo   oo   aca.
Hepee pep ope co-  oe  pepae.  He  ae
oc  pecp    oe  popa,  ae opaee  ca e
apeeo  oce aepe popa.

;---acpoae 6-o a pecpa ac pepa
   MOV   AL,01000000B   ;acpe  6
   OUT   21H,AL         ;ocae  pecp ac pepa
    .
   MOV   AL,0           ;
   OUT   21H,AL         ;oae IMR  oe popa

                 4. Hacae coceoo pepa.

   eec ecoo p  aca  coceoo  pepa.
Bo-epx,    oco      oox   pepa,   oeceaex
oepaoo cceo, o oe, a oe poep, oce 
cex  popa,    B  oee oea oa coe   oe.
Hapep, oe Ba popa o cooa poep, o
cpo  a pa epao.  Beco oo,  o a ee  a
popa  aece poep B oee cao ee a  pepae,
aca   popa,  oopa  ocaec  peeo    a  oce
aepe.  Toa  B  oee  cooa  INT  80H  eco
WRITE_VERTICALLY   (ee   ,   o  o  pepa  ecoo
eee, e o poep).
   Bopo po   aca   pepa  oe    cooae
aoo-o   oeoo   aapaoo   pepa.   o   pepae
aoaec  aec  p  ooe  opeeex co.  B
eoopx cax BIOS ape eop oo pepa a,  o
o  aae  a  poep,  oopa  ooe  eo  e  eae (oa
coep o oepaop IRET).  B  oee  aca  co  poep  
e  eop  pepa,  o  o  aa  a  ee.  Toa p
ooe aapaoo pepa e oc Baa  poepa.
Oa    ax poep o pepae pee co [2.1.0],  oopoe
aoaec aec 18.2 paa  ce- .  Oo o  pepae
oo  ooe  oaae aco,  o B oee oa  e o
o,  oop B oeaee.  Ec Ba o poepe oaa  aco  
cae  p  opeeee oe pee,  o oo oepa 
peao pee.

                           Cpe poe.

    25H  pepa  21H  caaae  eop  pepa   a
aa apec.  Apeca e paep a coa. Capee coo coep
aee  ceea  (CS),  aee  coep   ceee   (IP).   o
cao  eop,  aa  a  o    Bax  poep,  o
oec cee poep  DS,  a  ceee    DX  (ce  op
epeeoo  pepa).  ae  oece oep pepa-   AL 
oe .  a poepa  pepa  oa  aepac  e
oo cpe RET,  a IRET. (IRET aae  cea p coa,
a pecp ao,  o pe a RET oeae a ce oo a.
Ec  B oaeec ecpoa a poep a o poep,
o oac IRET,  o B cepaee ce.) Oe,  o  25H

                                     - 5 -
aoaec  ape-  ae  aapae pepa  poecce ee
eopa, oo e cece oacoc, o ocpe opo pooe
aapaoe   pepae,   coee  a  eop.

   ;---caoa pepa
   PUSH  DS             ;coxpae DS
   MOV   DX,OFFSET ROUT ;ceee  poep  DX
   MOV   AX,SEG ROUT    ;cee poep
   MOV   DS,AX          ;oeae  DS
   MOV   AH,25H         ; cao eopa
   MOV   AL,60H         ;oep eopa
   INT   21H            ;ee pepae
   POP   DS             ;occaaae DS

;---poepa pepa
ROUT  PROC  FAR
      PUSH  AX          ;coxpae ce eee pecp
       .
       .
      POP   AX          ;occaaae pecp
      MOV   AL,20H      ; e cpo ao cooa
      OUT   20H,AL      ;oo  aapax pepa
      IRET
ROUT  ENDP

   B oe oa aoo  Bax aapax pepa B o  -
 cee 2 cpo oa:

         MOV   AL,20H
         OUT   20H,AL

   o poco coaee, o ca (20H) o  e e  oex cpoax.
Ec  aapaoe  pepae  e  aaaec    cpo- a,  o
pocxea 8259 e oc  opa  pecpa  oca,  c  e
o a papeea opaoa pepa c oee  po, e
oo o opaoaoe.  Occe x cpo eo oe pec  
pax popa, a a pepa o aap copee ceo oac
aopoe  ae Ctrl-Alt-Del oaec  ecoe.  Oe,  o
a  oaa  e  a   ex eopo pepa,  oope c
pacpe cecx pepa, a a pepae 1CH, oopoe
oae o  pepa pee co.
   Koa popaa aepaec,  o  occaoe opae
eopa  pepa.  B  poo  cae  ocea popaa oe
a aoe pepae  epea paee a o eco  a, 
oopo  Bae poep e e.   35 pepa 21H opaae
eee aee eopa pepa,  oea aee ceea  ES, a
ceee    BX.  epe  caoo  coeo pepa oe eee
aee eopa,  co  ,  coxpae    ae,  
ae   occaoe   x  c  oo    25H  (a  e)  epe
aepee coe popa. Hapep:

;--- ceee ax:
   KEEP_CS  DW    0        ;xpa cee aeeoo pepa
   KEEP_IP  DW    0        ;xpa ceee pepa
;--- aae popa
            MOV   AH,25H     ; oe eopa
            MOV   AL,1CH     ;oep eopa
            INT   21H        ;eep cee  ES, ceee  BX
            MOV   KEEP_IP,BX ;aoae ceee

                                     - 6 -
            MOV   KEEP_CS,ES ;aoae cee
; --- oe popa
            CLI
            PUSH  DS         ;DS e pape
            MOV   DX,KEEP_IP ;oooa  occaoe
            MOV   AX,KEEP_CS ;
            MOV   DS,AX      ;oooa  occaoe
            MOV   AH,25H     ; cao eopa
            MOV   AL,1CH     ;oep eopa
            INT   21H        ;occaaae eop
            POP   DS         ;occaaae DS
            STI


   H poe.

   Ocae e  MS DOS poco oa  e ap co
 ax eax a. Ceee eopa oe  ceo poc
oee   oepa  eopa  a  4.  Hapep,  o  o  apec
pepa 16H  ES:BX:

;---oee apeca pepa 16H
   SUB   AX,AX         ;caaae ES a aao a
   MOV   ES,AX         ;
   MOV   DI,16H        ;oep pepa  DI
   SHL   DI,1          ;oae a 2
   SHL   DI,1          ;oae a 2
   MOV   BX,ES:[DI]    ;epe a a  BX
   MOV   AX,ES:[DI]+2  ;epe cap a  ES
   MOV   ES,AX         ;

   He peoeec po caaa eop pepa, oxo -
 DOS. B acoc  ooaao cpee oepaoa cc- ea oe
oepa ecoo a eopo pepa  pea ec
apec a oe  ece oo DOS.

               5. ooee  cece pepa.

   Xo   e aco,  o oa ae oeo oa o  cec-
e pepa.  B aece  pepa  paccop  popa,  oope
peopa  oo  aae a  e opeeee ooaee
coe cpo (apoopeee aap).   popa co-
 a, o ec o c aap ocae ocae epe 
0 pepa 16H BIOS [3.1.3].  Bce pepa oa c  aap  DOS
a  pepae  BIOS   oe coa  epa aap.
oo eoxoo opoa  pepae 16H,  a  opao,
o  oo  co  aao  apoopeee,  oce eo a
popaa e oa apoopeee,  eaco o  oo,  aoe
pepae oa c aap oa coe.
   Koeo, opoa pepa BIOS  DOS epoco,  oc- o
BIOS  pacooea  ,  a DOS ocae e ca  o opae
paepa oeeo  x a.  Ho B oee aca  poep,
oopa  peece  / cee a cooec pepae,  
a poepa oe ac p  oe  pepa  DOS    BIOS.
Hapep,    cae  pepa  16H,  Ba  o aca poep 
aa a ee eopo pe- pa    16H.  Opaoe  aee
eopa  16H  e  peee  epeocc    ao-o  ecoe
eop,  cae,  60H.  Hoa poepa poco ae pepae 60H,
o   coo-  a  opaoe  pepae  16H;  oo  oa

                                     - 7 -
popaa  ae  pepae  16H,   paee   epeaec   Bae
poepe,  oo-  pa  ae  ae  opaoe  pepae  16H,
oopa o aep- e o opaae paee Bae poepe,  a
 ee e B opaaeec  o eco popa,  oopoo  o
pepa 16H.  oce oo a o ceao,   oo  poepe  oe
coepac o o, a o, a  oce oa pepa-  60H. Bo
paa coa eoxox ec:

   1. Coa o poep, a pepae 60H.
   2. epeec eop pepa  16H  60H.
   3. e eop 16H, o o aa a o poep.
   4. aep popa, oca ee peeo [1.3.4].
[ | | ]










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