home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 83 / asm / source / delprog.z80 < prev    next >
Encoding:
Text File  |  2001-07-01  |  960 b   |  52 lines

  1. ; PROGRAM:    DELPROG
  2. ; VERSION:    1.01
  3. ; AUTHOR:     David Eriksson
  4. ; DATE:       10/05/96
  5.  
  6. #define equ    .equ                ; these will make ti83asm.inc and tokens.inc work in TASM
  7. #define EQU    .equ
  8.  
  9. .NOLIST
  10. .INCLUDE "ti83asm.inc"            ; TI83 System Routine Equates
  11. .INCLUDE "tokens.inc"            ; TI83 Tokens
  12. .LIST
  13.  
  14. .ORG     9327h                    ; All TI83 programs have base 9327h
  15.  
  16.     CALL    _ZEROOOP1            ; clear OP1
  17.     LD        A, 05h                ; object type is program
  18.     LD        (OP1), A
  19.     LD        DE, OP1+1            ; destination
  20.     LD        HL, program_name    ; source
  21.     LD        BC, 8                ; length of program name
  22.     LDIR                        ; copy!
  23.  
  24.     CALL    _CHKFINDSYM            ; search for symbol in OP1
  25.     JP        C, error            ; carry flag set if not found
  26.  
  27.     CALL    _DELVAR                ; delete program!
  28.     LD        HL, ok_msg
  29.  
  30.     JP        show_msg
  31.  
  32. error:
  33.     LD        HL, err_msg
  34.  
  35. show_msg:
  36.     CALL    _PUTS
  37.     CALL    _NEWLINE
  38.  
  39.     RET
  40.  
  41. program_name:
  42.     .DB        "DELETEME"
  43.  
  44. err_msg:
  45.     .DB        "Unknown program"
  46.     .DB        0
  47.  
  48. ok_msg:
  49.     .DB        "Program deleted",0
  50.  
  51. .END
  52.