[A83] Sucwelc interrupt prgm


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

[A83] Sucwelc interrupt prgm




Could somebody write me a interrupt prgm that waits
till apd should happen, but runs a prgm instead, or
when somebody tries to shut down the calc manually
this prgm also starts. The prgm is a password program
Suckerwelcome 3.0) and the executable should enable or
disable the interrupt like noprogs from Ian Graf.
The data of the password program should be inside the
executable file. This is the prgm data (in assembly):


;this is a TI-83- prgm
;I don't know if this could be run on a Ti-83+(SE).

;  SUCKERWELCOME V3.0
;  ------------------

;The default keys are <SIN> <COS> <TAN>;
;change the keys with prgmCONFIG.

; You may modify this source code for personal use only.
; You may NOT distribute the modified source or program file.

.nolist
#define end .end
#define END .end
#define equ .equ
#define EQU .equ
#include "ti83asm.inc"
#include "tokens.inc"

.list
#define apdvar 8265h
#define amount 8267h
.org 9327h

	jr start
	.db 3		;the amount of keys
keys:
	.db 38		;<SIN>
	.db 30		;<COS>
	.db 22		;<TAN>  are the default keys
	.db 0
	.db 0
	.db 0
	.db 0
start:
	call power
	call _clrlcdfull
	call _runindicoff
	call _homeup
	call _newline
	ld hl,welk
	call _puts
	call _newline
	call _newline
	ld hl,welk2
	call _puts
	ld hl,3911h
	ld (pencol),hl
	ld hl,suckertxt
	call _vputs

prekeycheck:
	ld a,(keys-1)
	ld (amount),a
keycheck:
	ld bc,20000
	ld (apdvar),bc
	call getcall
	or a
	jp nz,powergo
	push hl
	ld a,(amount)
	dec a
	ld (amount),a
	or a
	jr nz,keycheck

	ld a,(keys-1)
	ld (amount),a
realkeycheck:
	ld hl,keys
	ld d,0
	ld a,(amount)
	dec a
	ld e,a
	add hl,de
	ex de,hl
	pop hl
	ld a,l
	ex de,hl
	cp (hl)
	jr nz,othergets
	ld a,(amount)
	dec a
	ld (amount),a
	or a
	jr z,dispendtxt
	jr realkeycheck

getcall:
	res oninterrupt,(iy+onflags)	;Thanks to z3FX for solving this problem
	call _getk
	or a
	jr nz,continue
	ld bc,(apdvar)
	dec bc
	ld (apdvar),bc
	ld a,b
	or a
	jr nz,getcall
	ld a,c
	or a
	jr nz,getcall
time_over:
	ld a,1
	ret
continue:
	ld h,0
	ld l,a
	xor a
	ret

othergets:
	ld a,(amount)
	ld b,a
	ld a,7
	sub b
	ld (amount),a
	or a
	jr z,powergo
anotherget:
	ld bc,20000
	ld (apdvar),bc
	call getcall
	or a
	jr nz,powergo
	ld a,(amount)
	dec a
	ld (amount),a
	or a
	jr nz,anotherget
	jr powergo

powergo:
	call power
	jp prekeycheck

power:
	ld a,1
	out (3),a
	halt
	ret

dispendtxt:
	call _clrscrnfull
	call _homeup
	ld hl,380Dh
	ld (pencol),hl
	ld hl,sucwelcend
	jp _vputs

welk:   .db " Welcome to my  "
	.db "     Ti-83",0
welk2:  .db "  Don't try to  "
	.db " break the code!",0
suckertxt:
	.db "...Made by SUCKER...",0
sucwelcend:
	.db "Suckerwelcome v3.0",0
.end
END

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp





Follow-Ups: