home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / fish / disks / d1041.lha / Programs / Data2Object / example / asm / Main.S < prev    next >
Encoding:
Text File  |  1994-02-20  |  966 b   |  55 lines

  1. ;
  2. ; make a text-object with d2o:
  3. ;
  4. ;      d2o Main.s SYMBOL Text OBJECT Text.o
  5. ;
  6. ; compile your assembly-source to an object-file:
  7. ;
  8. ;      asm Main.S
  9. ;
  10. ;
  11. ; Now you've got the two object files:
  12. ;
  13. ;      Text.o    containing the text you want to use
  14. ;      Main.o    containing the main code
  15. ;
  16. ;
  17. ; Make an executable file with for example SAS/C slink:
  18. ;
  19. ;      slink from Main.o Text.o to Test
  20. ;
  21.  
  22.     xref    _lTextLen    ; 'Text' could be anything, it's just what
  23.     xref    _pText        ; you specified in d2o, option SYMBOL
  24.  
  25.     xdef    Main
  26.     
  27.     section    "TEXT",code
  28.     
  29. Main    move.l    $4.w,a6
  30.     moveq.l    #36,d0
  31.     lea    dosname(PC),a1
  32.     jsr    -552(a6)    OpenLibrary(a6)
  33.     tst.l    d0
  34.     bne.s    GotDos
  35.     moveq.l    #20,d0        error, could not open dos.library
  36.     rts
  37.     
  38. GotDos    move.l    d0,a6
  39.     jsr    -60(a6)        Output(a6)
  40.     move.l    d0,d1
  41.     lea    _pText,a0
  42.     move.l    a0,d2
  43.     move.l    _lTextLen,d3
  44.     jsr    -48(a6)        Write(a6)
  45.     
  46.     move.l    a6,a1
  47.     move.l    $4.w,a6
  48.     jsr    -414(a6)    CloseLibrary(a6)
  49.     moveq.l    #0,d0
  50.     rts
  51.     
  52. dosname    dc.b    'dos.library',0
  53.     
  54.     end
  55.