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

paee popaa

   oco popa  apac    a,  acac,  a ae
ac oepaoo cceo p aepe.  co- oo po
oo  e  e  aepa.  Ho    popaco  a acceepe
eec pa oooc  a pae eocppe ee.  Heoope
popa  ec  a  paep cpoc  paep pepa 
o o  coxpae    a  ("pee")  ae  oce  x
aepe   (eopa  pepa  oecea  exa,  ocpeco
oopoo  ocee  popa   o   opaac      pee
poepa).  oa  popae  eoxoo  ac    ce p
popa.  Ha cao ee DOS ooe popae  ap    a
op  o  COMMAND.COM,  oopa  oe  cooaa  a cpeco
epeca c ooae- e  oe oa a COPY  DIR.

                 1. ac oo popa  po.

   MS DOS oeceae  EXEC (oep 4BH pepa 21H),  pea-
  o  oo  popa  po.  epa popaa aaec
"poee", a apaea  acaea - "ooo".

   Cpe poe.

    4BH oee  coa,  e  ocae,  pe  epex  oo-
oex ao:
   1. ooo  a eco, ocoe popae.
   2. Coa o apaepo.
   3. ocpo cpo,  coepa  aoe,    po-
pa.
   4. Coxpa ae pecpo SS  SP  epeex.
   oco p  ape popa MS DOS ee e c oc- 
a,  o eoxoo ocoo eco  a.  Ec  e  ocoo
ac  a,  o e e eca  ap opo popa.  oce
oo a a ocooea,  B o poco oec  BX peeoe
co  16-ax  apapao,  aca 4AH  AH  o pepae
21H,  ea oc popae eo o co apapao,  oopoe e
peec.
   o apaepo,  a oop o aa ES:BX  o  14-a
o o a,  oop B o oec ce-  opa:

   DW   cee apec cpo cpe
   DD   cee  ceee oao cpo
   DD   cee  ceee epoo FCB
   DD   cee  ceee opoo FCB
   Cpoa cpe  -  o  cpoa,  cocoa    oo  oee ce-
a,  oop cee MS DOS  p  oe  popa.  ee
cpo cpe ae e, a  e o oo oap  co- o ae
CONFIG.SYS.  Hapep,  cpo oe  oeeo VERIFY = ON. poco
ae cpo c epoo eea, aep eo coo ASCII 0, oo
ae ce  ..  a oce eeo o ceoa  a
coa ASCII 0. Cpoa oa aac a pae apapaa (.e. ee
apec o o 16 oe    pae  ).  o  ao  e,  o
cooec   xo    oe  apaepo,  aa  a  cpo,
coep oo 2-aoe ceeoe aee.  Bce o e o,  ec
oa popaa oe paoa c o e cpoo cpe,  o  popaa
"poe".  B o cae ao poco oec a coa ASCII 0  
epe 2 aa oa apaepo.
   Cee 4 aa oa apaepo aa a oa cpo 

                                     - 2 -
apaeo  popa.  "Koaa  cpoa"  -  o coa cpoa,
opeea coco pao popa. p ape popa  DOS oa
oe e  poe EDITOR A:CHAPTER1\ NOTES.MS.  p o aec
peaop  e epeaec  aa    oaaoe  aoe  A  
eeeoo  op.  Koa  B ooaaee oa cpo 
EXEC,  o ao a oo oce ac opa,  o  e  
apaeo  popa.  epe  oao  cpoo  oe co a,
coepa  o cpo,   oa oa aepac  coo  
(ASCII 13).
   ocee 8 ao oa apaepo aa a  pae  o
ao  (FCB).  FCB  coep  opa  o  oo    x aax,
aax  oao cpoe.  Ec opaex  ao  e,  o  ao
ao  ce  8  a  coo  ASCII  0.  B [5.3.5] oceo,  a
paoae  FCB.  Haa  c  epc  MS  DOS  2.0,   cooae   FCB
eoaeo    B  oee  e a opa FCB,  eco oo
co o oe ecpopa ao (file handler),   oopo
oc    a  peocaec  o  ooo oep,  a e epe FCB
(ae ocaec  [5.3.5]).
   Haoe, B  o ocpo cpo c aae aoe,   
e aa.  a cpoa ee apae popa. DS:DX aae
a    cpo  p  oe EXEC.  a cpoa - caapa cpoa
ASCIIZ,  .e.  eo  oee,  e  caapa   cea   aa,
aepaea    oo    ASCII    0.    Hapep,    o    oe   
B:\NEWDATA\FILER.EXE, e coo  ooa- e o ASCII 0.
   oce oo  a  c  aaa  opa  oooea,  ocaec
oce aaa.  oco ce pecp  ee  ae-  o
aae, o ao coxpa cee cea  aae cea, c e o
o  o    occaoe,  oa  paee  e   opaeo
ae  aae.    x  coxpae coae epeee.  oco
aee pecpa DS ae e eeo,  o  epeee e  o
  ae,  o  ex  op  oa  e   oo- pe oepaop MOV
AX,DSEG  MOV DS,AX.  oce oo a SS  SP coxpae,  oece 0  
AL,    opa  oepa "apa  ac" (EXEC coec ae
 oepee.  ae oece 4AH  AH  oe  pepae  21H.  B
o   oe  ae  e  popa,  pe  popaa  "poe"
axoc  oca- oeo coco. MS DOS peocae oooc
popae  oo epea poe o opaa,  a opao o
 epea o  cac.  o acaec cao  aca,  o
p ooe o caaaec a epeoca,  a pecp AX 
o cae e opaa 1 -  epaoo oepa ,  2 -
ec a e ae,  5 - p coo oe, 8 - p exae a,
10 - ec epaa cpoa cpe  11 - ec eepe opa.
   po pep - poce  oox,  o aco oe eo
 e ao.  ec ocae e o apaepo  e coaa  cpoa
cpe.  o  oaae,  o apaeo popae e e epeaac
oaa cpoa  o cpea e  ao  e,  a      ae
popa.  B  o oo e pacpe- eee a,  coa
  (co) o apaepo  coxpa-  ae SS  SP.

;--- ceee ax
FILENAME     DB   'A:TRIAL.EXE',0  ;apae TRIAL.EXE
PARAMETERS   DW   7DUP(0)          ;eo o apaepo
KEEP_SS      DW   0                ;epeea  SS
KEEP_SP      DW   0                ;epeea  SP

;---epepacpeeee a
   MOV   BX,ZSEG          ;o # apapaa oa
   MOV   AX,ES            ;o # apapaa aaa
   SUB   BX,AX            ;c paep popa

                                     - 3 -
   MOV   AH,4AH           ;oep 
   INT   21H              ;epepacpeeee
;---aae a o apaepo
   MOV   AX,SEG PARAMETERS      ; ES - cee
   MOV   ES,AX                  ;
   MOV   BX,OFFSET PARAMETERS   ; BX - ceee
;---coxpa o SS  SP
   MOV   KEEP_SS,SS       ;coxpae SS
   MOV   KEEP_SP,SP       ;coxpae SP
;---aae a cpo e aa
   MOV   DX,OFFSET FILENAME     ;ceee -  DX
   MOV   AX,SEG FILENAME        ;cee -  DS
   MOV   DS,AX                  ;
;---apa popa
   MOV   AH,4BH           ; EXEC
   MOV   AL,0             ;pae "ap  ac"
   INT   21H              ;acae aa
;---ocec, occaaae pecp
   MOV   AX,DSEG          ;occaaae DS
   MOV   DS,AX            ;
   MOV   SS,KEEP_SS       ;occaaae SS
   MOV   SP,KEEP_SP       ;occaaae SP

;--- oe popa coae  cee
ZSEG     SEGMENT          ;c. [1.3.1]
ZSEG     ENDS

          2. Coxpaee popa  a oce aepe.

   popa, ocaee   pee    a,  o  c  
aece   px popa.  Oo ae popa ac
epe  ecoe  eop  pepa.  MS  DOS paccapae ae
popa a ac  oepaoo  cce,  aa  x  o  aoe
px  popa,  oope    ape ocec.  Peee
popa oo c  ope COM. popa, acae  ope EXE
oca-  pee  a eoo pee.
   aepee popa pepae  27H  ocae  ee  peeo  
a.  CS oe aa a aao PSP  oo,  o a 
paoaa  pao.  B  popaax  COM,  CS   cpa   caaaec
cooec   opao,  oo  ao  poco  aep  popa
pepae 27H.  B popaax EXE  ,  CS  epoaao  aae  a
ep a,  ce a PSP (.e. 100H). p op- ao aepe
EXE popa oce cp  RET  aae    cea  epe
ooee  a ae:  PUSH DX / MOV AX,0 / PUSH AX.  oco DS
epoaao aae a aao PSP,  o p oe x  ae
  cea ce oa a- ae a ceee 0  PSP,  e p -
aa  acaec  cp   INT   20H.   oo   INT   20H
oec,  a  o  caapa      aepe popa 
epea pae  DOS.  o aca pepae 27H  paoa  
EXE  popae  ao  oec 27H o opo a PSP (ep coep
a o cp INT),  a ae aep popa o RET.
  oox o ao pee e o pepae 27H,  DX oe
coepa ceee oa popa, ocaeoe o aaa PSP.

   Cpe poe.

   Beop pepa caaaec c oo   25H  pepa
21H,  oaoec,  o  poepa  oaaac  IRET.  Kpoe cao
poep,  caaaea popaa e oa ea e- o,  poe

                                     - 4 -
aa  eopa  pepa,  pcoe  DX ae-  cee
oa poep  aepe.   COM ao poco oece oepaop
INT  27H    oe popa.   EXE ao oece o oepaop 
epoe coo PSP  aepe popa o oepaopo RET.  oo
o o poep,  oc- ec apea popaa oa
a INT 70H.
   pee pep    oox  o  ao  (COM   EXE).  B oox
caoea  ea  FINISH    oe  oa  poep   pepa
(aoae,  o  a  $ ae aee cea oa  o oe).
 COM ao FINISH ae ceee o aaa PSP,  a  peec 
pepa 27H.  EXE ao ceee ocaec o epoo aa,
ceeo a PSP,  oo  e  eoxoo  pa  100H,  o
epeca  a  aao PSP.  ae,  o oec poep  aao
popa,   oe c caoo ac oa    peeo
op. po oo oc coco  cooa cp MOVSB
 epec oa poep   ecoe ac  PSP,  aa
co cee 60H, o ocooae 160 a a.
   Ca aa COM:
;---ec poepa pepa
BEGIN:     JMP   SHORT SET_UP  ;epexo a cao
ROUTINE    PROC  FAR
           PUSH  DS            ;coxpaee pecpo
            .
      (poepa)
            .
           POP   DS            ;occaoee pecpo
           IRET                ;opa  pepa
FINISH     EQU   $             ;oea oa poep
ROUTINE    ENDP

;---caoa eopa pepa
SET_UP:    MOV   DX,OFFSET ROUTINE  ;ceee poep  DX
           MOV   AL,70H             ;oep eopa pepa
           MOV   AH,25H             ; cao eopa
           INT   21H                ;caaae eop
;---aepee popa, oca peeo
           LEA   DX,FINISH          ;opeee pe. ceee
           INT   27H                ;aepee

   Ca aa EXE:

;---ec peea poepa
           JMP   SHORT SET_UP   ;epexo a cao
ROUTINE    PROC  FAR
           PUSH  DS             ;coxpaee pecpo
            .
       (poepa)
            .
           POP   DS             ;occaoee pecpo
           IRET                 ;opa  pepa
FINISH     EQU   $              ;oea oa poep
ROUTINE    ENDP

;---caoa eopa pepa
SET_UP:    MOV   DX,OFFSET ROUTINE  ;ceee poep  DX
           MOV   AX,SEG ROUTINE     ;cee poep  DS
           MOV   DS,AX              ;
           MOV   AL,70H             ;oep eopa pepa
           MOV   AH,25H             ; cao eopa

                                     - 5 -
           INT   21H                ;caoa eopa
;---aepee popa
           MOV   DX,FINISH+100H     ;ce ceee oa
           MOV   BYTE PTR ES:1,27H  ;ocae 27H  PSP
           RET                      ;aepae poep

    31H pepa 21H paoae aaoo, a cee oo,
o    DX  oo  coepac co 16-ax apapao,  peex
poepe (cee paepa poep,  aa o aaa PSP - c. 
pepe  [1.3.1]).  peeco  o    ec o,  o oa
epeae poeco popae o xoa, a opa o cace
poep.  Poeca  popaa oae o o c oo 
4DH pepa 21H. Ko xoa ocac  [7.2.5].

              3. apa  ac popax oepee.

   Oepe - o ac popa, oope ocac a ce,  o pe
a  eo  popa  peeo    a.  Koa  peec ,
oea a-o oepee, o o apaec  a  popaa
ae eo a poep.  Pae oepe o apac  oo
 o e eco a,  epepa pe o.  Hapep,  popaa
ee  a  ax  oe  ap  poep coppo,  a ae
epep ee poepo ee- pa oeo.  a exa  coec
 oo a.  Ho oa xopoa oo  ex poep, oope e
coc oc- oo,  ae ace opae   c  pe  
o, o popaa e oc co eeo.

   Cpe poe.

   MS DOS  coe  EXEC  ap oepee.  a ,
oep 4BH pepa 21H,  coec ae   ap    aca
oo  popa    po,  ec  oec  o  0  AL.  Ec  AL
oec o 3,  o oa e ape oepe.  B  o  cae  e
coaec  PSP,  oo  oepe  e ca- aaec a eaca
popaa.  Taa poepa poco apae oepe,  e epeaa e
pae.
   eec a  cocoa  oece  a    oepe.  Moe  
cooaa  o  oac  p  ea  popa,  o  ceao
oeea oac a a peea ooo popa.    EXEC
epeaec  oo  cee  apec,   aece o,  a e
ape oepe.  Koa oepe apaec  eo ooo popa,
o  popaa oa c oep apapaa,  a e apac
oepe,  caa.  C po copo, p ape  ceao oee
a MS DOS oeceae popa oe- po apapaa.
   B epeeo pepe coec apa  oee a.
oco  DOS  oo  popae  c  oc  a,  o caaa
eoxoo ocoo a c oo  4AH.  48H oo
o  a ocaoo oo,  o o o p ca oo 
oepee. a  opaae ae- e ceea oa  AX,  o
oep  apapaa  opeee  a  e ape oepe,  a ae o
ao apec oepe e ac ooo popao.
   Kpoe oa 3,  acaeoo  AL, B o cao  o -
 ee a apaepa.  DS:DX o aa a cpo, a  
a oepe,  aepae ao ASCII 0. Heoxoo aa ooe
 aa,  a pacpee .COM  .EXE,  oco DOS    ao
cae e cae, o o e popa a.
   Haoe, ES:BX  o  aa  a  4-a  o   apaepo,
oop coep (1) 2-a oep apapaa,  a e apac
oepe  (2) 2-a aop p,  oop e  cooac

                                     - 6 -
  p  apeco    oepee.  B  aece  oepa apapaa ao
cooa co, opaaeoe  AX,  oepa apapaa oeeoo
oa a. aop p ae ceee, o oopo o  -
ce apeca pex p  apaepo    oepee.  coe
oep   apapaa,   a   apaec  oepe.  oce  oo  a  o
caoe,  oe   oepe e ape.  poco e
    oepeo  a,  oo o  o a  ,
apa ce oe  oe oepe. Ec p opa- e caoe a
epeoca,  o  a oa  ee o e opae  AX.  Ko pae 1,
ec aa eep oep ,  2 - ec a e ae,  5 -  p
cox oax  8 - p occ ocaoo a.
   oce oo a oepe ape   a,    e  oo  o
oc  a    aeo (far) poepe.  B ceee ax oe 
caoe xco aae,  opee o o.  Ceea
ac  aae  poco  paa  ee  ooo cee.  Ceee
oepe oo  ceo axoee pa e ceea oa
   oepe    oee  peaa  a  16  (epeo  e  
apapao    a).  B  epeeo   pepe   e   epeee
OVERLAY_OFFSET    CODE_SEG  oee  oa  a  po   pao
cao aae.  Oa ape,  oepee  ae  oe  -
ac cpe CALL DWORD PTR OVERLAY_OFFSET.
   Oepe oe  oo popao co co ceea  ax  
cea,  xo  a  pao  coec  ceo  cee  ae
popa.  p  oe  oepe  aee  ceea  eo  coceoo
ceea ax oo  oeeo  DS.

;---aepae popa  ceeo
ZSEG         SEGMENT
ZSEG         ENDS

;--- ceee ax
OVERLAY_SEG    DW    ?
OVERLAY_OFFSET DW    ?             ;ceee oepe
CODE_SEG       DW    ?             ;cee oepe - oe
PATH           DB    'A:OVERLAY.EXE' ;ceoa a ceee
0BLOCK         DD    0             ;4-a o apaepo

;---ocooae a
   MOV   CODE_SEG,CS     ;coae o CS
   MOV   AX,ES           ;ope aee ceea PSP
   MOV   BX,ZSEG         ;apec ceea oa popa
   SUB   BX,AX           ;ce paoc
   MOV   AH,4AH          ;oep  SETBLOCK
   INT   21H             ;ocooae a
   JC    SETBLK_ERR      ;a epeoca oop o oe
;---oo a  oepe
   MOV   BX,100H         ;oo  oepe 1000H a
   MOV   AH,48H          ; oee a
   INT   21H             ;eep AX:0 aae a o
   JC    ALLOCATION_ERR  ;a epeoca oop o oe
   MOV   OVERLAY_SEG,AX  ;aacae apec ceea oepe
;---cee cee oepe  ooo ceee
   MOV   AX,CODE_SEG     ;ae aee ceea oepe
   MOV   BX,OVERLAY_SEG  ; ae ceea oa
   SUB   BX,AX           ;BX coep co apapao
   MOV   CL,4            ;cae o co a 4 a eo
   SHL   BX,CL           ;o o e  aax
   MOV   OVERLAY_OFFSET,BX  ;aoae ceee
;---apa epoo oepe

                                     - 7 -
   MOV   AX,SEG BLOCK    ;ES:BX aae a o apaepo
   MOV   ES,AX           ;
   MOV   BX,OFFSET BLOCK ;
   MOV   AX,OVERLAY_SEG  ;oeae apec ceea oepe 
   MOV   [BX],AX         ;epoe coo oa apaepo
   MOV   [BX]+2,AX       ;cee oepe - aop p
   LEA   DX,PATH         ;DS:DX aae a   a
   MOV   AH,48H          ;oep  EXEC
   MOV   AL,3            ;o ap oepe
   INT   21H             ;apae oepe
   JC    LOAD_ERROR      ;a epeoca oop o oe
;---eep popaa aaec co ea
    .
    .
   CALL  DWORD PTR OVERLAY_OFFSET  ;o oepe
    .     ;o aa DWORD PTR, a a oepe -
    .     ;aea poepa

;---ocope  cpp, oa ee ca oepe
DSEG     SEGMENT     ;a oo, caaae cee ax
            .        ;ocae ceo cee (coec
            .        ;ce ae popa)
DSEG     ENDS

CSEG     SEGMENT     PARA PUBLIC 'CODE'
OVERLAY  PROC FAR      ;cea "aea" poepa
         ASSUME CS:CSEG,DS:DSEG
         PUSH   DS     ;xpa DS ae popa
         MOV    AX,DSEG;caaae DS oepe
         MOV    DS,AX
          .
          .
         POP    DS     ;occaaae DS p aepe
         RET
OVERLAY  ENDP
CSEG     ENDS
         END

          4. peopaoae popa  a .EXE   .COM.

   popac a  acceepe  e  oooc  peopaoa  co
popa    ooo  opaa  EXE    opa  COM.  a EXE e
aooo,  coepa  opa     p;   DOS   pae
eoope  apeca popa p ape.  C po copo,  a COM
cec  ao e, o pa e peec - o xpac e 
o e,   oopo apaea popaa oa   a a.
o o pe a EXE o ee  epe  a  768  ao  oe  a
ce,  e  x  COM  ae (xo p ape  a o 
aa  oaooe  eco).  a  COM  ae  cpee  apac,
oco  e  peec  p.  px  peec   x e,  a
eoope popa co co  co  e,  o  x  oo
o peopaoa   COM.
   pa - o poecc cao  apeco,  cax  c  cee
pecpo. Hapep, popaa oe aa a aao oac ax
ce oo:
   MOV   DX,OFFSET DATA_AREA
   MOV   AX,SEG DATA_AREA
   MOV   DS,AX
   Ceee  DX cao c caoo ceeoo pecpa DS. Ho aoe

                                     - 8 -
aee oe pa ca DS? popaa pee aco-  apec,
o oep apapaa,   oopo e pacoaac DATA_AREA ac o
oo,   aoe eco  a e apea popaa - a o ac
o epc MS DOS,  a ae o oo,  ae peee popa  
axoc     ax  apecax  a.  o  o  pe  o  pe
ooo  popa  oo  oo  cao  eoope  ceee
ae epe cee oo- ceo aaa popa.  ae,  oa
DOS  ocece  p,  aee  aaoo   apeca   popa
paec  cee ae, aa acoe apeca, peee
 ceeo pecpe.
   a COM  e  ac  pe,  oco o xpac  ao
e,  o e ac  ca ceea.  Bce  popae  xpac
ooceo  aaa oooo ceea,  a ce ae  ce.  o
o pe c popaa e oe pea 65535 a o e,  o
cooece acao cee, oopoe cece  coeo
cxee apeca (oco epx ac oo oa aa ceo,  o
peaoe  pocpaco  ocoe   oa  ax eoo ee e
65535 a,  xo ceo cee p eoxooc oe  ece
a  pa  64K aoo oa).  B aax COM ce ceee pecp
aa a aao PSP;  cpae c aa EXE, e DS  ES a-
pc aao opao,  o CS aae a ep a ce
a PSP.
    pecae  popa    e aa COM peec coee
cex pa:
   1. He oope popa  e poep. Beco oo, oece
 caoe aao e, poe START,  aepe popa oepaopo END
START.
   2. oece  aae popa oepaop ORG 100H.  o oepa-  op
aae aao oa (.e.  caaae ce oa).  popa
COM aac c 100H,  o ec ep ao,  ce a  PSP,
oco CS aae a aao PSP,  oopoe pacooeo a 100H a
e.  oo o aa oee c oo poo eca oece
o apec 100H cp JMP.
   3. Oepaop ASSUME oe caaa DS,  ES  SS a  opao,
o  o  coaa  co  aee   oooo ceea,  apep,
ASSUME CS:CSEG, DS:CSEG, ES:CSEG, SS:CSEG.
   4. ae popa o oeac  o ece popa, o ex
op, oa o e epeea c oo. e aa popa c oac
ax,  oco  apoacceep  oe aa cooe o oax
p epo  poxoe,  ec  ec  cc  a  eaop  ax,
oop  ee  e  oape.    epexoa  aa oa coe 
aece epo oa popa cp JMP.
   5. He  cooa ca ceeo a MOV AX,SEG NEW_DATA.
ocaoo aa ooo cee e.  B acoc, o oca
o  o,  coe    aae popa  cao ceea
ax, MOV AX,DSEG / MOV DS,AX.
   6. Ceo cee ooc ocaec  aao oe. aae
cea apec a ep apecoo pocpaca  64K,  co-
eoo  popao  (aoae,  o  ce  pace   a).  B
popaax COM o oe  cea ee e 64K, SS  SP o 
ee. ee , o p oooe popa ooo ac
cooee  o  oe,  aaee,  o  cee  cea  occe.
oppe eo.
   7. aepe popa o cpe RET,  o pepae  20H.
pepae  20H  -  o  caapa   aepe popa 
opaa pae  DOS.  ae oa popaa a- epaec cp-
e  RET,  a  cao ee coec pepae 20H.  o pocxo
oo,  o epa cea epoaao co- ep 0.  p  oe
aepae   cp  popa  RET,  0  aaec    cea,

                                     - 9 -
epeaaa ce oa a aao PSP.  Haxoac   o  ee
 20H,  oec a ce- a cp popa, a
epea pae  DOS. Bce o oaae, o Ba e ao p cape
popa  oea a ce DS  0 (PUSH DS / MOV AX,0 / PUSH AX),  a
o peec  EXE ao.
   oce oo   a   popaa   cocppoaa  a  opao,  ac-
cepe  ooe ee a oo.  ae peopae ee   op
COM c oo  EXE2BIN,  eec  MS DOS. Ec  popa,
ocpoeo oooo MYPROG.EXE, o poco ee oa EXE2BIN
MYPROG.  B peae B oe popa a c ee MYPROG.BIN.
Bce o Ba ocaec oce oo ce- a - epeeoa o a 
MYPROG.COM.  B  oee ae cpa cooa oa EXE2BIN MYPROG
MYPROG.COM,  oe-  aa c pacpee COM.

   H poe.

   B ao pepe coepc oa opoa  popaa,  oopa  o
caoe  epeaee  opeee oeco aoee  ae 
ae o cooee a pa.  Oa oe c pepo  opoo
 oo copa,  oopx opa COM eae. CSEG SEGMENT
              ORG 100H
              ASSUME CS:CSEG, DS:CSEG, SS:CSEG
;---ae
START:        JMP  SHORT BEGIN  ;epexo  o
MESSAGE1      DB   'The dip switches are set for $'
MESSAGE2      DB   'disk drive(s).$'
;---ea epo ac cooe
BEGIN:        MOV  AH,9    ; 9 pepa 21H - o
              MOV  DX,OFFSET MESSAGE1  ;cpo
              INT  21H     ;o cpo
              PUSH AX      ;coxpae oep  a ee
;---oae cao epeaee  opa A pocxe 8255
              IN   AL,61H  ;oae a  opa B
              OR   AL,10000000B  ;caaae  7
              OUT  61H,AL        ;aee a
              IN   AL,60H        ;oae cao epea.
              AND  AL,11000000B  ;ee cape 2 a
              MOV  CL,6          ;oooa  c AL pao
              SHR  AL,CL         ;cae 2 a  aao
              ADD  AL,49         ;oae 1, o ca c 1
                                 ; 48  epeoa  ASCII
              MOV  DL,AL         ;oeae pea  DL
              MOV  AL,61H        ;o occao op B
              AND  AL,01111111B  ;cpacae  7
              OUT  61H,AL        ;opaae a
;---ea ca aoee
              MOV  AH,2          ; 2 pepa 21H
              INT  21H           ;eaae co  DL
;---ea opo oo cooe
              POP  AX            ;epe oep  co cea
              MOV  DX,OFFSET MESSAGE2
              INT  21H           ;o cpo
              INT  20H           ;aepee popa
CSEG          ENDS
              END START
[ | | ]










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