;this is a sample program that displays a history entry ;it should have all error checking built right in ;it should also compile under asm studio 3.1 with its standard ;include files. ;By Andy Hochhaus 7/4/00 Any Comments or Questions? ; Email me at ti86z80@aol.com #include "ti86asm.inc" .org _asm_exec_ram nop jp ProgStart .dw 0 .dw ShellTitle ShellTitle: .db "New Assembly Program",0 ProgStart: ld a,1 ;entry number to display ld (_currlastentry),a ld a,50 ;location to display at ld (_penRow),a ld (_penCol),a disphistentry: ld a,(_currlastentry) ld b,a ld a,(_numlastentries) cp b ret c ;check to see if (_currlastentry) is smaller then (_numlastentries) call $4627 ;_GETLASTENTRY get ptr to history entry call _ex_ahl_bde push af push hl call _get_word_ahl push de push de ld hl,equvarname-1 rst 20h pop hl call _createequ call _ex_ahl_bde call _set_abs_dest_addr ld a,0 pop hl call _ahl_plus_2_pg3 call _set_mm_num_bytes pop hl pop af call _set_abs_src_addr call _mm_ldir ;copy compiled entry out to a temporary program variable ld hl,equvarname-1 rst 20h call $53ca ;_setupEditequ open prog in editor call $51d9 ;_detok detokenize call $53d2 ;_bufToTop go to the top xor a ; insert $00 at the top call $53ae ;_bufInsert to mark it as uncompiled call $544a ;_closeEditequ close prog editor ;program var is now decompiled (plain text form) ld hl,equvarname-1 rst 20h rst 10h call _ex_ahl_bde call _get_word_ahl call _inc_ptr_ahl disploop: ;displays 0 terminated string at AHL in variable width font call $521d ;_get_word_ahl call $463b ;_dec_ptr_ahl push af push hl push de ld a,e call $4aa1 ;_vputmap pop de ld a,d cp 0 pop hl pop de ld a,d jr nz,disploop ld hl,equvarname-1 ;deletes temporary variable rst 20h rst 10h call _delvar ret equvarname: .db 2,"tv" .end