

;            --------------------- MESSAGE ---------------------
;
;     MESSAGE  is  a  reminder  program  which  repeats  back to you a
;     message after a specified number of minutes.  A typical example
;     would be to "Turn off the sprinkler" after 15 minutes.
;
;     This  is  version two of a very simple program.  Version one was
;     written  in Pascal, was WB2+ only, and was missing a function I
;     needed.  Here is the assembly version!
;
;     It's  smaller,  faster  and  should  hum  along on all breeds of
;     Amigas.
;
;     MESSAGE has two windows.  The first has a string gadget in which
;     you can type a message of up to 128 characters.
;
;     There  is  also  a  "minutes"  gadget which will take an integer
;     value  of up to 9999 minutes (about 7 days).  You quit from this
;     "entry"  window  by  either  selecting  the  "OK" gadget, which
;     activates  the  timer,  or  by clicking the close window gadget
;     which halts the program.
;
;     After  your  designated  time,  the message window will pop up.
;     This window has your message inside.  At this time, all screens
;     should "flash" and your machine should "beep".
;
;     You  can  either  quit from this window by selecting "OK" or the
;     close   gadget,   both  of  which  will  halt  the  program,  or
;     alternatively  you  may request a "REPEAT" of the message, which
;     will restart the timer.
;
;     I  hope that you find this program useful.  If not, feel free to
;     use it as a pot plant holder.  If it stomps all over your Amiga,
;     I'm sorry, but you use it at your own risk!
;
;     This  program  is  FREEWARE, as is the source code.  Copy it and
;     enjoy it.
;
;     Anthony Peck
;     68 Woralul St
;     Waramanga ACT 2611
;     AUSTRALIA
;
;     Anthony.Peck@Radford.act.edu.au
;
;     Thanx to my bestest friend and loyal supporter Kym.  She makes
;     great coffee and even better kids!
;
;     Compiler report
;     ---------------
;     935 lines in 0.82 sec = 68414 lines/min.
;     Global symbols: 97
;     Local symbols:  6
;     Bytes gained by optimization: 200
;     Code:   1 section(s)     1725 bytes
;     Data:   1 section(s)     1568 bytes
;     BSS:  none

; Some Useful Definitions
; -----------------------
;
; You'll find all of these in the various includes that come with
; a compiler like DevPac.  Some are defined in structures such as
; "GADGET", while others are library offsets.  If you are stuck for
; such definitions, check out HexTract by Chas Wyndham (Fish 817).

; Simple equivalents

ExecBase                = $04      ; ExecBase (!)
Wd_rport                = $32      ; Window RastPort (Window structure)
Wd_userport             = $56      ; Window UserPort (Window structure)
Pr_cli                  = $ac      ; CLI offset in process structure
Pr_msgport              = $5c      ; Message port for process structue
Im_class                = $14      ; Class for IDCMP message
Iaddress                = $1c      ; Address of IDCMP message
Gg_gadgetid             = $26      ; Gadget ID (Gadget structure)
Gadgetup                = $40      ; Gadget pressed
Gadclosewindow          = $200     ; Close window pressed
NumChars                = $10      ; Number of chars in stringinfo

; Library Vector Offsets

_LVOOpenLibrary         = -$0228   ; Exec function - "Old" for WB1.3
_LVOCloselibrary        = -$019e   ; Exec function
_LVOOpenwindow          = -$CC     ; Intuition function
_LVODelay               = -$C6     ; Dos function
_LVOPrintIText          = -$D8     ; Intuition function
_LVOWaitport            = -$0180   ; Exec function
_LVOFindtask            = -$0126   ; Exec function
_LVOForbid              = -$84     ; Exec function
_LVOClosewindow         = -$48     ; Intuition function
_LVOSetwindowtitles     = -$0114   ; Intuition function
_LVOGetmsg              = -$0174   ; Exec function
_LVOReplymsg            = -$017a   ; Exec function
_LVODisplayBeep         = -$60     ; Intuition function

; Some Useful Macros
; ------------------
;
; Macros waste memory and increase the size of the code, but they
; make life a bit easier and the code a bit more readable.  All of
; these are used to access the appropriate library functions.  The
; library bases are loaded, the LVO prefix is added, and then the
; function is called.  Simple!

Callexec        Macro
        Move.L  ExecBase,A6        ; Move Exec into a6
        Jsr     _LVO\1(A6)         ; Add Library offset and call function
                Endm

Callint         Macro
        Move.L  _intuitionbase,A6  ; Move Intuition into a6
        Jsr     _LVO\1(A6)         ; Add Library offset and call function
                Endm

Calldos         Macro
        Move.L  _dosbase,A6        ; Move Dos into a6
        Jsr     _LVO\1(A6)         ; Add Library offset and call function
                Endm

; Wb Startup Code
; ---------------
;
; I modified this slightly from that which is provided with the
; includes that come with DevPac.  You can get similiar code
; in the Public Domain, see STARTUPS on Fish 101.  All they do is
; allow you to start your program from WB.

        Movem.L  D0/A0,-(Sp)        ;    save initial values
        Clr.L    Returnmsg          ;    clear message
        Sub.L    A1,A1              ;    subtract address
        Callexec Findtask           ;    find this task
        Move.L   D0,A4              ;    move process to a4
        Tst.L    Pr_cli(A4)         ;    test if we are from CLI
        Beq      Fromworkbench      ;    otherwise go to workbench
        Movem.L  (Sp)+,D0/A0        ;    restore registers
        Bra      End_startup        ;    and run the program

Fromworkbench:

        Lea      Pr_msgport(A4),A0  ;    load the message port
        Callexec Waitport           ;    wait for a message
        Lea      Pr_msgport(A4),A0  ;    load the message port
        Callexec Getmsg             ;    then get it
        Move.L   D0,Returnmsg       ;    save it for later reply
        Movem.L  (Sp)+,D0/A0        ;    restore registers

End_startup:

        Jsr      Start              ;    call the program

        Move.L   D0,-(Sp)           ;    save it
        Tst.L    Returnmsg          ;    test if message
        Beq      Exittodos          ;    if I was a CLI
        Callexec Forbid             ;    forbid(!)
        Move.L   Returnmsg(Pc),A1   ;    load message
        Callexec Replymsg           ;    message received!

Exittodos:

        Move.L   (Sp)+,D0           ;    exit code
        Rts

; Program Starts Here
; -------------------
;
; The above code points to this Start identifier, which is where
; the actual program starts!

Start:

        Jsr      Openint            ; Open intuition library
        Jsr      Opendos            ; Open dos library
        Jsr      Win1               ; Open first window
        Jsr      Changetitle        ; Change the screen title

Mainloop:

; This bit of code waits for messages from the first window and then
; processes them.

        Jsr      Waitformess        ; Bide time until user inputs
        Move.L   Winhd,A0           ; Move window handle into a0
        Move.L   Wd_userport(A0),A0 ; UserPort offset
        Callexec Getmsg             ; Macro gets window message
        Move.L   D0,A1              ; Message transferred to a1
        Move.L   A1,Message         ; Message saved for analysis
        Callexec Replymsg           ; Message received!
        Move.L   Message,A0         ; Load message into a0
        Move.L   Im_class(A0),D6    ; Message class offset
        Cmpi.L   #Gadclosewindow,D6 ; Was the close gadget pressed
        Beq      Cleanup            ; Yes!  Outta here...
        Move.L   Iaddress(A0),A0    ; Gadget address offset
        Move.L   Gg_gadgetid(A0),D5 ; Gadget ID offset

        Cmpi.L   #$30000,D5         ; Was the "OK" gadget pressed
        Beq      Errors             ; Yes!  See if there are any errors

        Bra      Mainloop           ; Head back if gadget 1 or 2 ->

Errors:

; If the "OK" gadget was pressed, we need to check to see that some
; basic conditions have been satisfied.  E.g. Has an message been
; specified?  And a time?

CheckMessage:

        Lea     Messageinfo,A2      ; Load the message structure
        Move.W  NumChars(A2),D3     ; Move to number of characters offset
        Tst.W   D3                  ; Test if anything was entered
        Bne     CheckTime           ; If OK move on...
        Move.L  #$00,A0             ; All screens to beep!
        Callint DisplayBeep         ; Beep the display to wake up user
        Lea     NoInput,A1          ; ...else load the message pointer...
        Bra     ErrorMessage        ; ...and display the error

CheckTime:

        Lea     Minutesinfo,A2      ; Load the minutes structure
        Move.W  NumChars(A2),D3     ; Move to number of characters offset
        Tst.W   D3                  ; Test if anything was entered
        Bne     DisplayMess         ; If OK move on...
        Move.L  #$00,A0             ; All screens to beep!
        Callint DisplayBeep         ; Beep the display to wake up user
        Lea     NoTime,A1           ; ...else load the message pointer...
        Bra     ErrorMessage        ; ...and display the error

DisplayMess:

; The second window displays the message specified by the user, and gives
; them the option of repeating the message, or quitting the program.

        Jsr      Closewin           ; Close the first window
        Lea      Minutesinfo,A5     ; Load the Minutes structure
        Move.L   $1C(A5),D1         ; Move the integer entered to D1
        Mulu     #$0BB8,D1          ; Multiply by 50 ticks and 60 seconds
        Calldos  Delay              ; Waiting!
        Jsr      Win2               ; Open the new window
        Jsr      Changetitle        ; Change the screen title

        Move.L  #$00,A0             ; All screens to beep!
        Callint DisplayBeep         ; Beep the display to wake up user

        Move.L   #$10,xoff          ; Reset values in case this is the
        Move.L   #$10,yoff          ; second (etc.) time around
        Move.L   xoff,D0            ; Move x-offset to D0
        Move.L   yoff,D1            ; Move y-offset to D1
        Move.L   Winhd,A0           ; Load window handle
        Move.L   Wd_rport(A0),A0    ; Shift to window rast port
        Lea      MSTitletxt,A1      ; The text structure...
        Callint  PrintIText         ; ...and write it!

        Lea      Messagebuff,A2     ; Load the infile structure
1$      Clr.L    D4                 ; Clear our character counter
        Add.L    #$0C,yoff          ; Shift offset to next line
        Jsr      ClearTemp          ; Clear the temporary buffer
        Lea      Tempbuff,A3        ; Load temporary buffer
2$      Move.B   (A2)+,D3           ; Shift one character and increment
        Cmp.B    $00,D3             ; Was it a dud?
        Beq      4$                 ; Yes!  Outta here ->
        Move.B   D3,(A3)+           ; ...else shift it into temp buffer
        Addq.B   #$01,D4            ; Add 1 to counter
        Cmp.B    #$3C,D4            ; Have we reached 60?
        Beq      3$                 ; Yes!  Outta here ->
        Bra      2$                 ; ...else branch to next character
3$      Move.B   -(A3),D3           ; Move back one character
        Clr.B    (A3)               ; Clear it from the temp buffer
        Cmp.B    #$20,D3            ; Is it a space?
        Beq      4$                 ; Yes!  Outta here ->
        Move.B   D3,-(A2)           ; Else shift it back to Messagebuff...
        Bra      3$                 ; ...and go back to next character ->
4$      Move.L   xoff,D0            ; Move x-offset to D0
        Move.L   yoff,D1            ; Move y-offset to D1
        Lea      Temptxt,A1         ; The text structure
        Move.L   Winhd,A0           ; Move in window handle
        Move.L   Wd_rport(A0),A0    ; Shift to window rast port
        Callint  PrintIText         ; Print it!
        Cmp.B    #$20,D3            ; Was that last one a space?
        Bne      5$                 ; No!  Outta here ->
        Bra      1$                 ; ...else back to next line ->

5$      Jsr      Waitformess        ; Bide time until user inputs
        Move.L   Winhd,A0           ; Move window handle into a0
        Move.L   Wd_userport(A0),A0 ; UserPort offset
        Callexec Getmsg             ; Macro gets window message
        Move.L   D0,A1              ; Message transferred to a1
        Move.L   A1,Message         ; Message saved for analysis
        Callexec Replymsg           ; Message received!

        Move.L   Message,A0         ; Load message into a0
        Move.L   Im_class(A0),D6    ; Message class offset
        Cmpi.L   #Gadclosewindow,D6 ; Was the close gadget pressed
        Beq      Cleanup            ; Yes!  Outta here...
        Move.L   Message,A0         ; ...else Load message into a0
        Move.L   Iaddress(A0),A0    ; Gadget address offset
        Move.L   Gg_gadgetid(A0),D5 ; Gadget ID offset

        Cmpi.L   #$10000,D5         ; Was the "OK" gadget pressed
        Beq      Cleanup            ; Yes!  Bye ->

        Cmpi.L   #$20000,D5         ; Was the "REPEAT" gadget pressed
        Beq      DisplayMess        ; Yes!  Back to the start ->

        Bra      Cleanup            ; Anything else? (Not likely - but
                                    ; just to be sure...

ErrorMessage:

        Move.L  Winhd,A0            ; Move window handle into a0
        Lea     Screentitle,A2      ; Load the screen title into a2
        Callint Setwindowtitles     ; Macro changes screen title
        Bra     Mainloop            ; Back to the mainloop ->

; Subroutines
; -----------
;
; These sections of code are either re-used several times, or are
; just easy to put somewhere at the end of the program where no-one
; will mind too much!

Openint:

; The opening of the intuition library, including an error branch if things
; don't go according to plan!

        Lea      Intname,A1         ; Load intuition library into a1
        Callexec OpenLibrary        ; Macro opens library
        Beq      Exittodos          ; If it doesn't open, we quit
        Move.L   D0,_intuitionbase  ; Save the return address
        Rts                         ; ...and back at you ->

Opendos:

; The opening of the dos library, including an error branch if things
; don't go according to plan!

        Lea      Dosname,A1         ; Load dos library into a1
        Move.L   #$00,D0            ; Any version will do
        Callexec OpenLibrary        ; Macro opens library
        Beq      NoDos              ; If there's a problem, close down
        Move.L   D0,_dosbase        ; Save the return address
        Rts                         ; ...and back at you ->

NoDos:

; If dos fails to open, we need to close intuition.

        Jsr     Closeint            ; Jump to close intuition subroutine
        Bra     Exittodos           ; Then off!

Win1:

; This little bit opens the first window.

        Lea     Win1_defs,A0        ; Load window definitions to a0
        Jsr     Openwin             ; Open the window
        Rts                         ; ...and back at you ->

Win2:

; This little bit opens the second window.

        Lea     Win2_defs,A0        ; Load window definitions to a0
        Jsr     Openwin             ; Open the window
        Rts                         ; ...and back at you ->

Waitformess:

; Rather than check all the time if the window has spoken to intuition,
; we use the userport of the window structure to wait for a message
; before doing anything else.  Low maintenance!

        Move.L   Winhd,A0           ; Move window handle into a0
        Move.L   Wd_userport(A0),A0 ; UserPort offset at byte 86
        Callexec Waitport           ; Macro waits for message from window
        Rts                         ; ...and back at you ->

Changetitle:

; Here we change the workbench screen title.

        Move.L  Winhd,A0           ; Move window handle into a0
        Movea.L #-1,A1             ; Move current window title into a1
        Lea     Screentitle,A2     ; Load the screen title into a2
        Callint Setwindowtitles    ; Macro changes screen title
        Rts                        ; ...and back at you ->

Openwin:

; Just calls the function and stores the window handle.

        Callint Openwindow          ; Macro opens window
        Move.L  D0,Winhd            ; Save return address (window handle)
        Rts                         ; ...and back at you ->

ClearTemp:

; Here we clear the 60 bytes of the Temporary buffer.

        Move.B  #$3C,D1             ; Move 60 counter to D4
        Lea     Tempbuff,A5         ; Load the temp buffer
1$      Move.B  #$00,(A5)+          ; Clear a byte and increment
        Subq.B  #$01,D1             ; Decrease counter by 1
        Cmpi.B  #$00,D1             ; At zero yet?
        Bne     1$                  ; No!  Go back ->
        Rts                         ; ...else return

Cleanup:

; Finally it's over, but before we can go home we need to do some quick
; housekeeping!

        Jsr     Closewin            ; Close window
        Jsr     Closedos            ; Close dos
        Jsr     Closeint            ; Close intuition
	Rts                         ; back to startup code

Closewin:

; Closes the window.

        Move.L  Winhd,A0            ; Move window handle into a0
        Callint Closewindow         ; Macro closes window down
        Rts                         ; ...and back at you ->

Closedos:

; Closes the dos library.

        Move.L   _dosbase,A1        ; Move dos base into a1
        Callexec Closelibrary       ; Macro closes dos
        Rts                         ; ...and back at you ->

Closeint:

; Closes the intuition library.

        Move.L   _intuitionbase,A1  ; Move intuition base into a1
        Callexec Closelibrary       ; Macro closes intuition
        Rts                         ; ...and back at you ->

; Structures and Memory Allocation
; --------------------------------
;
; Here are the definitions held for the structures used in the
; program, as well as memory blocks Set aside for definitions such
; as the messages.

Win1_defs:

; Window structure

        Dc.W    $B4                ; x-offset on screen
        Dc.W    $5D                ; y-offset on screen
        Dc.W    $118               ; window width
        Dc.W    $46                ; window height
        Dc.B    $01                ; print colour
        Dc.B    $03                ; background colour
        Dc.L    $00000240          ; IDCMP flags: CLOSEWINDOW|GADGETDOWN
        Dc.L    $0000100e          ; ACTIVATE|WINDOWDRAG|WINDOWDEPTH
                                   ; WINDOWCLOSE
        Dc.L    GadInput           ; First Gadget
        Dc.L    $00                ; Standard Checkmark
        Dc.L    Winname            ; Window name
        Dc.L    $00                ; screen pointer
        Dc.L    $00                ; no custom bitmap
        Dc.W    $00,$00,$00,$00    ; intuition sets these given that...
        Dc.W    $01                ; this is a WORKBENCH screen

Win2_defs:

; Window structure

        Dc.W    $44                ; x-offset on screen
        Dc.W    $5D                ; y-offset on screen
        Dc.W    $01F4              ; window width
        Dc.W    $46                ; window height
        Dc.B    $01                ; print colour
        Dc.B    $03                ; background colour
        Dc.L    $00000240          ; IDCMP flags: CLOSEWINDOW|GADGETDOWN
        Dc.L    $0000100e          ; ACTIVATE|WINDOWDRAG|WINDOWDEPTH
                                   ; WINDOWCLOSE
        Dc.L    GadOK2             ; First Gadget
        Dc.L    $00                ; Standard Checkmark
        Dc.L    Winname            ; Window name
        Dc.L    $00                ; screen pointer
        Dc.L    $00                ; no custom bitmap
        Dc.W    $00,$00,$00,$00    ; intuition sets these given that...
        Dc.W    $01                ; this is a WORKBENCH screen

GadInput:

; Gadget structure

        Dc.L    GadTime            ; next gadget
        Dc.W    $1C                ; x-offset on window
        Dc.W    $14                ; y-offset on window
        Dc.W    $DC                ; gadget width
        Dc.W    $0E                ; gadget height
        Dc.W    $04                ; Inverted Image type
        Dc.W    $01                ; RELVERIFY
        Dc.W    $04                ; STRING
        Dc.L    InMessage          ; Data for picture of gadget
        Dc.L    $00                ; Alternative image
        Dc.L    Inputtxt           ; text around gadget
        Dc.L    $00                ; no mutual exclude
        Dc.L    Messageinfo        ; special string info
        Dc.W    $01                ; Gadget Identification
        Dc.L    $00                ; no User Data

GadTime:

; Gadget structure

        Dc.L    GadOK1             ; next gadget
        Dc.W    $1C                ; x-offset on window
        Dc.W    $32                ; y-offset on window
        Dc.W    $2D                ; gadget width
        Dc.W    $0D                ; gadget height
        Dc.W    $04                ; Inverted Image type
        Dc.W    $801               ; RELVERIFY|INTEGER
        Dc.W    $04                ; STRING
        Dc.L    Time               ; Data for picture of gadget
        Dc.L    $00                ; Alternative image
        Dc.L    Timetxt            ; text around gadget
        Dc.L    $00                ; no mutual exclude
        Dc.L    Minutesinfo        ; special string info
        Dc.W    $02                ; Gadget Identification
        Dc.L    $00                ; no User Data

GadOK1:

; Gadget structure

        Dc.L    $00                ; no more gadgets for this window
        Dc.W    $D2                ; x-offset on window
        Dc.W    $2F                ; y-offset on window
        Dc.W    $2A                ; gadget width
        Dc.W    $0D                ; gadget height
        Dc.W    $04                ; Inverted Image type
        Dc.W    $01                ; RELVERIFY
        Dc.W    $01                ; BOOLEAN
        Dc.L    OK                 ; Data for picture of gadget
        Dc.L    $00                ; no other image
        Dc.L    $00                ; no text around gadget
        Dc.L    $00,$00            ; no exclude,no special info
        Dc.W    $03                ; Gadget Identification
        Dc.L    $00                ; no User Data

GadOK2:

; Gadget structure

        Dc.L    GadRepeat          ; no more gadgets for this window
        Dc.W    $01BE              ; x-offset on window
        Dc.W    $34                ; y-offset on window
        Dc.W    $2A                ; gadget width
        Dc.W    $0D                ; gadget height
        Dc.W    $04                ; Inverted Image type
        Dc.W    $01                ; RELVERIFY
        Dc.W    $01                ; BOOLEAN
        Dc.L    OK                 ; Data for picture of gadget
        Dc.L    $00                ; no other image
        Dc.L    $00                ; no text around gadget
        Dc.L    $00,$00            ; no exclude,no special info
        Dc.W    $01                ; Gadget Identification
        Dc.L    $00                ; no User Data

GadRepeat:

; Gadget structure

        Dc.L    $00                ; no more gadgets for this window
        Dc.W    $017C              ; x-offset on window
        Dc.W    $34                ; y-offset on window
        Dc.W    $3D                ; gadget width
        Dc.W    $0D                ; gadget height
        Dc.W    $04                ; Inverted Image type
        Dc.W    $01                ; RELVERIFY
        Dc.W    $01                ; BOOLEAN
        Dc.L    Repeat             ; Data for picture of gadget
        Dc.L    $00                ; no other image
        Dc.L    $00                ; no text around gadget
        Dc.L    $00,$00            ; no exclude,no special info
        Dc.W    $02                ; Gadget Identification
        Dc.L    $00                ; no User Data

Inputtxt:

; Intuitext structure

        Dc.B    $01,$01,$00        ; FrontPen,BackPen,DrawMode

        Even                       ; Fill to make even address for word

        Dc.W    $38,$0E            ; Left edge, top edge
        Dc.L    $00                ; No special font
        Dc.L    Inputtx            ; The actual text
        Dc.L    $00                ; No next text

MSTitletxt:

; Intuitext structure

        Dc.B    $01,$03,$05        ; FrontPen,BackPen,DrawMode

        Even                       ; Fill to make even address for word

        Dc.W    $00,$00            ; Left edge, top edge
        Dc.L    $00                ; No special font
        Dc.L    MSTitletx          ; The actual text
        Dc.L    $00                ; No next text

Temptxt:

; Intuitext structure

        Dc.B    $02,$01,$00        ; FrontPen,BackPen,DrawMode

        Even                       ; Fill to make even address for word

        Dc.W    $00,$00            ; Left edge, top edge
        Dc.L    $00                ; No special font
        Dc.L    Tempbuff           ; The actual text
        Dc.L    $00                ; No next text

Timetxt:

; Intuitext structure

        Dc.B    $01,$00,$01        ; FrontPen,BackPen,DrawMode

        Even                       ; Fill to make even address for word

        Dc.W    $32,$00            ; Left edge, top edge
        Dc.L    $00                ; No special font
        Dc.L    Timetx             ; The actual text
        Dc.L    $00                ; No next text

Messageinfo:

; Stringinfo structure

        Dc.L    Messagebuff        ; Buffer for input text
        Dc.L    Undobuff           ; Buffer for undo function (Amiga-Q)
        Dc.W    $00                ; Buffer start position
        Dc.W    $80                ; Number of characters
        Dc.W    $00,$00,$00        ; DispPos,UndoPos,NumChars
        Dc.W    $00,$00,$00        ; DispCount,CLeft,CTop
        Dc.L    $00,$00,$00        ; Layer,LongInt,Keymap

Minutesinfo:

; Stringinfo structure

        Dc.L    Timebuff           ; Buffer for input text
        Dc.L    Undotimebuff       ; Buffer for undo function (Amiga-Q)
        Dc.W    $00                ; Buffer start position
        Dc.W    $05                ; Number of characters
        Dc.W    $00,$00,$00        ; DispPos,UndoPos,NumChars
        Dc.W    $00,$00,$00        ; DispCount,CLeft,CTop
        Dc.L    $00,$00,$00        ; Layer,LongInt,Keymap

; Memory allocations

_intuitionbase: Ds.L    $01        ; memory for intuition base
_dosbase:       Ds.L    $01        ; memory for dos base
Winhd:          Ds.L    $01        ; memory for window handle
Returnmsg:      Ds.L    $01        ; memory for WB return message
Message:        Ds.L    $01        ; memory for WB return message
xoff:           Dc.L    $10        ; declare x-offset
yoff:           Dc.L    $10        ; declare y-offset
Messagebuff:    Ds.B    $80        ; memory for message buffer
Timebuff:       Ds.B    $05        ; memory for time buffer
Undobuff:       Ds.B    $80        ; memory for message Undo
Undotimebuff:   Ds.B    $05        ; memory for time Undo
Tempbuff:       Ds.B    $3C        ; memory for temporary buffer

;       Other text

Inputtx:        Dc.B    "Enter Message",$00
Timetx:         Dc.B    "Minutes",$00
MSTitletx:      Dc.B    "Your Message:",$00
Winname:        Dc.B    "A N Peck - 1995",$00
NoInput:        Dc.B    "Enter a Message!",$00
NoTime:         Dc.B    "Enter a Time!",$00
Screentitle:    Dc.B    "Freeware - enjoy in good health",$00
Intname:        Dc.B    "intuition.library",$00  ; intuition library name
Dosname:        Dc.B    "dos.library",$00        ; dos library name

; Image Data
; ----------
;
; Here are the images used, all converted by the wonderful program
; Convbrush by David Kinder.  There are various other similar
; utilities, but I like this one because it was written in Pascal!
; Using such images blows out the size of the executable a bit, but
; gosh it looks pretty!

        Section Image,Data_C

InMessage       Dc.W    -$07,-$03,240,15,2
                Dc.L    InMessagedat
                Dc.B    3,0
                Dc.L    0
InMessagedat    Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00256,16383
                Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
                Dc.W    65535,65535,65535,65535,65535,64256,12288,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00768,12288,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00768,12288,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00768,12288,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00768,12288,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00768,12288,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00768
                Dc.W    12288,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00768,12288
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00768,12288,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00768,12288,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00768,12288,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00768,08192,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00768,32767,65535,65535,65535,65535,65535
                Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
                Dc.W    65280
                Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
                Dc.W    65535,65535,65535,65535,65535,65535,65024,49152
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,01024,49152,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,03072,49152,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,03072,49152,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,03072,49152,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,03072,49152,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    03072,49152,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,03072
                Dc.W    49152,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,03072,49152
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,03072,49152,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,03072,49152,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,03072,49152,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000,00000,03072,57343,65535,65535,65535,65535
                Dc.W    65535,65535,65535,65535,65535,65535,65535,65535
                Dc.W    65535,64512,32768,00000,00000,00000,00000,00000
                Dc.W    00000,00000,00000,00000,00000,00000,00000,00000
                Dc.W    00000

Time            Dc.W    -$07,-$03,64,14,2
                Dc.L    Timedat
                Dc.B    3,0
                Dc.L    0
Timedat         Dc.W    00000,00000,00000,02048,16383,65535,65535,55296
                Dc.W    12288,00000,00000,06144,12288,00240,00000,06144
                Dc.W    12288,00408,00000,06144,12288,00440,00000,06144
                Dc.W    12288,00504,00000,06144,12288,00472,00000,06144
                Dc.W    12288,00408,00000,06144,12288,00240,00000,06144
                Dc.W    12288,00000,00000,06144,12288,00000,00000,06144
                Dc.W    08192,00000,00000,06144,32767,65535,65535,63488
                Dc.W    65535,65535,65535,61440,49152,00000,00000,08192
                Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
                Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
                Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
                Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
                Dc.W    49152,00000,00000,24576,49152,00000,00000,24576
                Dc.W    57343,65535,65535,57344,32768,00000,00000,00000

Repeat          dc.w    0,0,61,13,2
                dc.l    Repeatdat
                dc.b    3,0
                dc.l    0
Repeatdat       dc.w    00000,00000,00000,00008,00000,00000,00000,00024
                dc.w    00000,00000,00000,00024,00248,64760,64632,64536
                dc.w    00204,49356,49356,12312,00204,49356,49356,12312
                dc.w    00248,61688,61692,12312,00216,49344,49356,12312
                dc.w    00204,49344,49356,12312,00204,64704,64716,12312
                dc.w    00000,00000,00000,00024,00000,00000,00000,00024
                dc.w    32767,65535,65535,65528
                dc.w    65535,65535,65535,65520,49152,00000,00000,00000
                dc.w    49152,00000,00000,00000,49152,00000,00000,00000
                dc.w    49152,00000,00000,00000,49152,00000,00000,00000
                dc.w    49152,00000,00000,00000,49152,00000,00000,00000
                dc.w    49152,00000,00000,00000,49152,00000,00000,00000
                dc.w    49152,00000,00000,00000,49152,00000,00000,00000
                dc.w    32768,00000,00000,00000

OK              Dc.W    0,0,42,13,2
                Dc.L    OKdat
                Dc.B    3,0
                Dc.L    0
OKdat           Dc.W    00000,00000,00064,00000,00000,00192,00000,00000
                Dc.W    00192,00001,58928,00192,00003,13920,00192,00003
                Dc.W    14016,00192,00003,14208,00192,00003,14016,00192
                Dc.W    00003,13920,00192,00001,58928,00192,00000,00000
                Dc.W    00192,00000,00000,00192,32767,65535,65472
                Dc.W    65535,65535,65408,49152,00000,00000,49152,00000
                Dc.W    00000,49152,00000,00000,49152,00000,00000,49152
                Dc.W    00000,00000,49152,00000,00000,49152,00000,00000
                Dc.W    49152,00000,00000,49152,00000,00000,49152,00000
                Dc.W    00000,49152,00000,00000,32768,00000,00000

                End     ; Adios Amigoids

