home *** CD-ROM | disk | FTP | other *** search
-
-
- * Opens a window on a screen, and prints a message in it
-
-
-
-
- LONG _IntuitionBase _GfxBase
-
- LONG Screen Window IMClass MsgSave
- WORD IMCode
-
-
-
- _IntuitionBase = OpenLibrary( "intuition.library" 0 )
- beq Exit
-
- _GfxBase = OpenLibrary( "graphics.library" 0 )
- beq Exit
-
- a1 = #NewScr
- a0 = _GfxBase
- 6(a1) = 216(a0) w ;NewScr.Height = GfxBase.NormalDisplayRows
-
- Screen = OpenScreen( #NewScr )
- beq Exit
-
- a0 = #NewWin
- 30(a0) = Screen ;NewWin.Screen = Screen
-
- Window = OpenWindow( #NewWin )
- beq Exit
-
- a0 = Window
- Move( 50(a0) 20 30 )
-
- a0 = Window
- Text( 50(a0) "I hope you enjoy using EZAsm!" 29 )
-
-
- * Check for messages..
-
-
- CheckMsg
-
- a1 = Window
- WaitPort( 86(a1) ) ;Window.UserPort
-
- GetMessage
-
- a1 = Window
- MsgSave = GetMsg( 86(a1) )
- beq CheckMsg
-
- * Got something..
-
- a1 = MsgSave
- IMClass = 20(a1) ;save Class
- IMCode = 24(a1) ;save Code
-
- ReplyMsg( d0 )
-
- IMClass = 512 Exit ;CLOSEWINDOW?
-
- jmp GetMessage
-
-
- Exit
-
- Window != 0 {
-
- Forbid( ) ;( stop messages )
-
- FreeLoop a1 = Window
- GetMsg( 86(a1) )
-
- d0 != 0 {
- ReplyMsg( d0 )
- jmp FreeLoop
- }
-
- CloseWindow( Window )
- Permit( )
- }
-
- Screen != 0 {
- CloseScreen( Screen )
- }
-
- _GfxBase != 0 {
- CloseLibrary( _GfxBase )
- }
-
- _IntuitionBase != 0 {
- CloseLibrary( _IntuitionBase )
- }
-
-
-
- END
-
-
-
-
-
- NewScr ds.w 0 ;( word align )
- dc.w 0,0,640,0,2 ;LeftEdge,TopEdge,Width,Height,Depth
- dc.b -1,-1 ;DetailPen,BlockPen
- dc.w $8000,$000f ;ViewModes,Type
- dc.l 0,0 ;Font,DefaultTitle
- dc.l 0 ;Gadgets
- dc.l 0 ;CustomBitMap
-
-
- * ViewModes = HIRES
-
- * Type = CUSTOMSCREEN
-
-
-
- NewWin ds.w 0 ;( word align )
- dc.w 20,20,400,150 ;LeftEdge,TopEdge,Width,Height
- dc.b -1,-1 ;DetailPen,BlockPen
- dc.l $00000200 ;IDCMPFlags
- dc.l $0002100f ;Flags
- dc.l 0,0,0 ;FirstGadget,CheckMark,Title
- dc.l 0,0 ;Screen,BitMap
- dc.w 400,75 ;MinWidth,MinHeight
- dc.w $ffff,$ffff ;MaxWidth,MaxHeight
- dc.w $000f ;Type
-
-
- * IDCMPFlags = CLOSEWINDOW
-
- * Flags = WINDOWCLOSE | SMART_REFRESH | ACTIVATE | WINDOWDRAG |
- * WINDOWDEPTH | WINDOWSIZING | NOCAREREFRESH
-
- * Type = CUSTOMSCREEN
-
-