home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PCACHSRC.ZIP / MASTREXE.ASM < prev    next >
Assembly Source File  |  1990-07-12  |  2KB  |  36 lines

  1. ;MASTREXE.ASM                           B.Kauler
  2. ;--> MASTREXE.OBJ + SLAVEXE.OBJ + SERF.OBJ --> MASTREXE.EXE
  3. ;A demonstration of linking .EXE files.
  4. ;...............................................................
  5. stack1  segment stack            ;'stack' not required on the end.
  6.         db      256     dup(0)
  7. stack1  ends
  8. ;...............................................................
  9. data    segment public  'data'   ;'data' useful for linker.
  10.         extrn   data1:byte
  11. local_data  db  "this is local data",0Ah,0Dh,"$"
  12. data    ends
  13. ;...............................................................
  14. code    segment public  'code'   ;'code' useful for linker.
  15.         assume  cs:code, ds:data ;tells Assembler default code & data
  16.                                  ;segments for the instructions to follow.
  17.         extrn   slave_routine:near
  18. master_routine  proc    far
  19.         mov     ax,data          ;When prog loads, DS not set to DATA
  20.         mov     ds,ax            ;segment, so do it here.
  21.         mov     dx,offset local_data
  22.         mov     ah,9
  23.         int     21h              ;display a message.
  24. ;the interesting bit....
  25.         call    slave_routine
  26. ;interesting here also....
  27.         mov     dx,offset data1  ;DATA1 is external.
  28.         mov     ah,9
  29.         int     21h              ;display message.
  30.         mov     al,0
  31.         mov     ah,4Ch
  32.         int     21h              ;back to DOS
  33. master_routine  endp
  34. code    ends
  35.         end     master_routine
  36.