A83: Clock interrupt prog


[Prev][Next][Index][Thread]

A83: Clock interrupt prog




Hey, a while back before I was thrown off the list (how, I don't know...) 
I was talking/asking about interupts.  I have since been trying to write 
a clock TSR/interupt but, althoug it compiles fine, it screws up the 
calc.  I tried changing the end from jp 3ah to reti to rst 38h.  Any 
input/help would be GREATLY appreciated.

		-Dimitri

Here it is:
#include "ti83asmd.inc"		;Includes all TI-83 func equates
.LIST				;have no idea what this does
.org 9327h			;every asm program starts @ address 9327h

#define df #define
; var addresses can start @ 80E0h...
df msec         8265h           ;Milliseconds
df sec          8266h           ;Seconds
df min          8267h           ;Minutes
df hour         8268h           ;Hours
df day          8269h           ;Day
df month        826Ah           ;Month
df year         826Bh           ;Year

top:
	ld	hl,8300h
	ld	de,8301h
	ld	bc,256
	ld	(hl),84h
	ldir

	ld	hl,int
	ld	de,8484h
	ld	bc,intend-int
	ldir

	ld	a,83
	ld	i,a
	im	2
	ret
	

int:
        ex	af,af'
	ld      a,(msec)
        inc     a
        ld      (msec),a
        cp      200
        ret     nz

;	di			;do I need this?
        ex	af,af'
	exx     
        xor     a
	ld      (msec),a
        ld      a,(sec)
        inc     a
        ld      (sec),a
        ;write sec to screen
	ld	l,a
	xor	h
	xor	a
	ld	(currow),a
	ld	a,7
	ld	(curcol),a
	call	_disphl	
	cp      60
        ret     nz

        xor     a
        ld      (sec),a
        ld      a,(min)
        inc     a
        ld      (min),a
        ;write min to screen
	ld	l,a
	xor	h
	xor	a
	ld	(currow),a
	ld	a,4
	ld	(curcol),a
	call	_disphl	
        cp      60
        ret     nz

        xor     a
        ld      (min),a
        ld      a,(hour)
        inc     a
        ld      (hour),a
        ;write hour to screen
	ld	l,a
	xor	h
	xor	a
	ld	(currow),a
	ld	a,1
	ld	(curcol),a
	call	_disphl	
        cp      24
        ret     nz

        xor     a
        ld      (hour),a
        ld      a,(day)
        inc     a
        ld      (day),a
        ;need to add month stuff, too
        ret
	exx
	ex	af,af'
;	ei				;if I DI @ beginning, then I need 
to EI here
;	rst	38h			;didn't work(?)
	jp	3Ah
intend:

.end



;{*whew!*}