home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / prog-asm / assemtls.lzh / ASSEMTOOLS / ASOURCE / WINDOW.ASM < prev   
Encoding:
Assembly Source File  |  1991-08-16  |  2.5 KB  |  169 lines

  1. ;
  2. ; ###        v 1.00 ###
  3. ;
  4. ; - Created 871130 by JM -
  5. ;
  6. ;
  7. ; Opens a window - delays - closes the window - exits.
  8. ;
  9. ;
  10. ;
  11. ; Bugs: None known.
  12. ;
  13. ;
  14. ; Edited:
  15. ;
  16. ;
  17. ;
  18.         INCLUDE    "exec/types.i"
  19. ;        INCLUDE "exec/alerts.i"
  20. ;        INCLUDE "exec/libraries.i"
  21.         INCLUDE "libraries/dos.i"
  22.         INCLUDE "intuition/intuition.i"
  23.         INCLUDE "graphics/gfxbase.i"
  24.  
  25.  
  26.  
  27.         XREF    _LVOOpenLibrary
  28.         XREF    _LVOCloseLibrary
  29.         XREF    _LVOOutput
  30.         XREF    _LVOWrite
  31.         XREF    _LVOOpenWindow
  32.         XREF    _LVOCloseWindow
  33.  
  34.  
  35. SETC        MACRO
  36.         OR    #1,CCR
  37.         ENDM
  38.  
  39. CLRC        MACRO
  40.         AND    #254,CCR
  41.         ENDM
  42.  
  43. SETX        MACRO
  44.         OR    #16,CCR
  45.         ENDM
  46.  
  47. CLRX        MACRO
  48.         AND    #239,CCR
  49.         ENDM
  50.  
  51.         JMP    Start
  52.  
  53.  
  54. MyWindow    DC.W    0,0,200,100    ;upper x,y , bottom x,y
  55.         DC.B    1,2        ;detailpen, blockpen
  56.         DC.L    0        ;IDCMPFlags
  57.         DC.L    WINDOWSIZING    ;Flags
  58.         DC.L    0        ;gadgets
  59.         DC.L    0        ;checkmark
  60.         DC.L    MyWinTitle    ;title
  61.         DC.L    0        ;screen
  62.         DC.L    0        ;bitmap
  63.         DC.W    0,0,300,200    ;min-max size
  64.         DC.W    WBENCHSCREEN    ;type
  65.  
  66. MyWinTitle    DC.B    'ThisIsMine!',0,0
  67.  
  68.         DS.L    0
  69.         
  70.  
  71.  
  72. Start        MOVEM.L    D2-D7/A2-A6,-(sp)
  73.         MOVE.L    D0,_CMDLen
  74.         MOVE.L    A0,_CMDBuf
  75.         BSR    OpenDOS
  76.         BEQ    NoDOS
  77.  
  78.         BSR    OpenIN
  79.         BEQ    NoIN
  80.  
  81.         BSR    OpenGFX
  82.         BEQ    NoGFX
  83.  
  84.  
  85.  
  86.         LEA    MyWindow(PC),A0
  87.         MOVE.L    _INBase(PC),A6
  88.         JSR    _LVOOpenWindow(A6)
  89.         MOVE.L    D0,_Ikkuna
  90.  
  91.         MOVE.L    #100000,D0
  92. Loop:        SUBQ.L    #1,D0
  93.         BNE    Loop
  94.  
  95.  
  96.         MOVE.L    _Ikkuna(PC),A0
  97.         MOVE.L    _INBase(PC),A6
  98.         JSR    _LVOCloseWindow(A6)
  99.  
  100.  
  101. Leave        BSR    CloseGFX
  102. NoGFX        BSR    CloseIN
  103. NoIN        BSR    CloseDOS        
  104.  
  105. NoDOS        MOVEM.L    (sp)+,D2-D7/A2-A6
  106.         RTS
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. OpenDOS        MOVE.L    4,A6        ;get execbase
  114.         LEA    DOSLib(PC),A1    ;get addr of library name
  115.         MOVEQ.L    #0,D0        ;any revision of dos
  116.         JSR    _LVOOpenLibrary(A6)
  117.         MOVE.L    D0,_DOSBase    ;save base address
  118.         RTS
  119.  
  120. CloseDOS    MOVE.L    _DOSBase(PC),A1    ;library pointer
  121.         MOVE.L    4,A6        ;execbase
  122.         JSR    _LVOCloseLibrary(A6)
  123.         RTS
  124.  
  125.  
  126. OpenIN        MOVE.L    4,A6        ;get execbase
  127.         LEA    INLib(PC),A1    ;get addr of library name
  128.         MOVEQ.L    #0,D0        ;any revision of intuition
  129.         JSR    _LVOOpenLibrary(A6)
  130.         MOVE.L    D0,_INBase    ;save base address
  131.         RTS
  132.  
  133. CloseIN        MOVE.L    _INBase(PC),A1    ;library pointer
  134.         MOVE.L    4,A6        ;execbase
  135.         JSR    _LVOCloseLibrary(A6)
  136.         RTS
  137.  
  138.  
  139. OpenGFX        MOVE.L    4,A6        ;get execbase
  140.         LEA    GFXLib(PC),A1    ;get addr of library name
  141.         MOVEQ.L    #0,D0        ;any revision of graphics library
  142.         JSR    _LVOOpenLibrary(A6)
  143.         MOVE.L    D0,_GFXBase    ;save base address
  144.         RTS
  145.  
  146. CloseGFX    MOVE.L    _GFXBase(PC),A1    ;library pointer
  147.         MOVE.L    4,A6        ;execbase
  148.         JSR    _LVOCloseLibrary(A6)
  149.         RTS
  150.  
  151.  
  152. DOSLib        DC.B    'dos.library',0,0
  153.         DS.L    0
  154. INLib        DC.B    'intuition.library',0,0
  155.         DS.L    0
  156. GFXLib        DC.B    'graphics.library',0,0
  157.  
  158.         DS.L    0
  159.  
  160. _DOSBase    DS.L    1
  161. _INBase        DS.L    1
  162. _GFXBase    DS.L    1
  163. _OutFile    DS.L    1
  164. _Ikkuna        DS.L    1
  165. _CMDLen        DS.L    1
  166. _CMDBuf        DS.L    1
  167.  
  168.  
  169.