home *** CD-ROM | disk | FTP | other *** search
- *
- * display current time on monochr. monitor * use vertical blank interrupt
- * as corrected from Chap.2 'Tricks and Tips' ABACUS 1986 CJPurcell 21AUG'86
- * normally used in autoboot with LOGIKRON or eSTeClock; can be key-clicked
- *
- gemdos equ 1
- setexec equ 5
- bios equ 13
- xbios equ 14
- gettime equ 23
- super equ 38 execute routine in supervisor mode
- keep equ $31
- _v_bas_ad equ $44e screen address
- hz_200 equ $4ba 200hz system timer
- *
- * system font ATARI ST
- *
- fontdat equ 76 ptr to font data
- formwd equ 80 status of next raster line in font
- formhg equ 82 number of raster lines per character
- line1 equ 80 bytes per screen line
- linea equ $a000 linea operator(pseudo instruction)for ATARI
- * .text:
- move.l 4(sp),a0 calculate program size
- move.w #$100,d6
- add.l 12(a0),d6
- bsr init program initialization
- clr -(sp)
- move.l d6,-(sp) number bytes
- move #keep,-(sp)
- trap #gemdos
- init dc.w linea get linea pointers for initialization;d0,a0,a1,a2
- moveq #2*4,d0 font number ; of the three in array of reg a1
- lea fontptr(pc),a3 use smallest font for color; middle for mono
- move.l (a1,d0),(a3) mark font pointer
- move #gettime,-(sp)
- trap #xbios
- addq.l #2,sp
- move d0,d7
- pea sup_rout(pc)
- move #super,-(sp) execute rest in supervisor mode
- trap #xbios
- addq.l #6,sp
- rts
- sup_rout:
- move d7,d0
- and #%11111,d0
- lsl #1,d0 seconds in binary
- move d0,second
- move d7,d0
- lsr #5,d0
- and #%111111,d0
- move d0,minute
- move d7,d0
- moveq #11,d1
- lsr d1,d0
- move d0,hour
- move #$2700,sr interrupts disabled
- move.l hz_200,time
- add.l #200,time
- pea hz_int(pc)
- move #$45,-(sp) timer c interrupt vector
- move #setexec,-(sp)
- trap #bios
- addq.l #8,sp
- move.l d0,hz_save 200hz vector mark
- rts
- hz_int movem.l d0-d7/a0-a6,-(sp) save registers
- move.l time,d0
- cmp.l hz_200,d0 one second yet?
- bne no_show no
- add.l #200,time next second
- addq #1,second
- cmp #60,second check seconds
- bne show_time
- clr second
- addq #1,minute next minute
- cmp #60,minute ckeck minutes
- bne show_time
- clr minute
- addq #1,hour
- cmp #24,hour check hours
- bne show_time
- clr hour
- show_time:
- move #68,d6 cursor position;(adj. to allow .BAK op.in edit)
- move hour,d0 get hour
- bsr wrtdec
- bsr wrtcol
- move minute,d0 get minute
- bsr wrtdec
- bsr wrtcol
- move second,d0 get second
- bsr wrtdec
- no_show movem.l (sp)+,d0-d7/a0-a6
- move.l hz_save,-(sp) address of routine
- rts
- wrtdec:
- move #$2f,d1 number 10
- wrtdec1 addq #1,d1
- sub #10,d0
- bpl wrtdec1
- add #$3a,d0 one digit
- move d0,-(sp)
- move d1,d0
- bsr wrtchar output
- move (sp)+,d0 unit
- bra wrtchar output
- wrtcol moveq #$3a,d0 ':'
- * write characters to graphic ram
- * where: d0 = character
- * d6 = cursor column
- wrtchar:
- moveq #0,d1
- move d6,d1
- addq #1,d6 move cursor to next column
- move.l fontptr(pc),a3 get font pointer
- add.l _v_bas_ad,d1 plus screen address
- move.l d1,a4
- move.l fontdat(a3),a0 font data pointer
- move formwd(a3),d2 offset of next raster line in font
- move formhg(a3),d7 form height (number pf scan lines)
- subq #1,d7
- loop move.b (a0,d0),(a4) onscreen raster line
- add #line1,a4 pointer to next screen line
- add d2,a0 pointer to next raster line in font
- dbra d7,loop
- rts
- fontptr ds.l 1
- hz_save ds.l 1
- second ds.w 1
- minute ds.w 1
- hour ds.w 1
- time ds.l 1
- .end
-