; PROGRAM:    DELPROG
; VERSION:    1.01
; AUTHOR:     David Eriksson
; DATE:       10/05/96

#define equ	.equ				; these will make ti83asm.inc and tokens.inc work in TASM
#define EQU	.equ

.NOLIST
.INCLUDE "ti83asm.inc"			; TI83 System Routine Equates
.INCLUDE "tokens.inc"			; TI83 Tokens
.LIST

.ORG     9327h					; All TI83 programs have base 9327h

	CALL	_ZEROOOP1			; clear OP1
	LD		A, 05h				; object type is program
	LD		(OP1), A
	LD		DE, OP1+1			; destination
	LD		HL, program_name	; source
	LD		BC, 8				; length of program name
	LDIR						; copy!

	CALL	_CHKFINDSYM			; search for symbol in OP1
	JP		C, error			; carry flag set if not found

	CALL	_DELVAR				; delete program!
	LD		HL, ok_msg

	JP		show_msg

error:
	LD		HL, err_msg

show_msg:
	CALL	_PUTS
    CALL    _NEWLINE

	RET

program_name:
	.DB		"DELETEME"

err_msg:
	.DB		"Unknown program"
	.DB		0

ok_msg:
	.DB		"Program deleted",0

.END
