home *** CD-ROM | disk | FTP | other *** search
- ;GOODDAY.ASM
-
- CR EQU 0DH
-
- Cseg segment
- assume CS:Cseg , DS:Cseg
- org 100H
-
- Enter: jmp Begin
- ;---------------------------------
- db CR,'GOODDAY from R.M.Wilson, c(o) 1986',26
- string1 db ' Good ',CR
- string2 db ' Morning! ',CR
- string3 db 'Afternoon!',CR
- string4 db ' Evening! ',CR
- string5 db ' Night! ',CR
- string6 db ' T G I F ',CR
-
- hold db 80 dup(0) ;Holds 8 bytes for 10 characters.
- screen dw 0B000H ;Will be set correctly.
- ;---------------------------
- Begin: xor ax,ax ;First, decide which monitor.
- mov DS,ax
- mov ax,0B000H
- test byte ptr DS:[410H],10H
- jne Over1
- add ax,800H ;if color monitor
- Over1: push CS
- pop DS
- mov screen,ax
- mov ES,ax
- mov cx,2000
- mov ax,1320H
- xor di,di
- rep stosw ;Clear screen.
-
- xor bp,bp
- xor di,di
- call Send ;Say "Good".
-
- mov ah,2CH
- int 21H ;Get time.
- cmp ch,6
- jb Nigh
- cmp ch,12
- jb Morn
- cmp ch,18
- jb Afte
- jmp short Even
-
- Morn: mov bp,11
- jmp short Over2
-
- Afte: mov bp,22
- jmp short Over2
-
- Even: mov bp,33
- jmp short Over2
-
- Nigh: mov bp,44
- jmp short Over2
-
- Over2: mov di,8*160
- call Send
- mov ah,2AH ;Check whether it's Friday.
- int 21H
- cmp al,5
- jne Cursor
- mov bp,55
- mov di,17*160
- call Send
- Cursor:
- xor bh,bh ;Place the cursor and return.
- mov dx,0F00H
- mov ah,2
- int 10H
- ret
- ;------------------------------------------
-
- Form: mov bl,CS:string1[bp]
- cmp bl,CR
- jne Over
- ret
-
- Over: xor bh,bh
- shl bx,1
- shl bx,1
- shl bx,1 ;mult by 8
- push si
- add si,bx
- mov cx,8
- rep movsb
- pop si
- inc bp
- jmp Form
-
- Send: push di ;This routine writes the message at offset 3+bp
- push CS ;on the screen starting at offset di.
- pop ES
- mov si,0FA6EH ;Point DS:si to address in ROM
- mov ax,0F000H ;where character set is stored.
- mov DS,ax
- mov di,offset hold
- call Form
- push CS
- pop DS
- pop di
- mov ax,CS:screen
- mov ES,ax
- xor bp,bp
-
- Up2: mov si, offset hold
- add si,bp
- mov cx,10
- Up: lodsb
- mov bl,80H ;8 bytes
- Up3: push ax
- mov dl,32
- and al,bl
- jz Over4
- mov dl,219
- Over4: mov ES:[di],dl
- mov byte ptr ES:[di+1],13H
- inc di
- inc di
- ror bl,1
- pop ax
- cmp bl,80H
- jne Up3
- add si,7
- loop Up
- inc bp
- cmp bp,8
- jl Up2
- ret
- ;-----------------------
- Cseg ends
- end Enter