A83: Lists


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

A83: Lists




here you go you pansies. it wasn't that hard, i made this in 20 mins,
and most of that involved commenting it (god this was simple to make).
all a ya can stop whining now. i told you to look at ti's documentation
but i guess you can't read swahili. =)

this one displays element 1 of list IAN. just compile it and send it to
your calc. then type this into a new program.

:923497->lIAN(1)    923497 could be any number (even floating point)
:Send(9prgmZLIST    but NOT complex!

to change the name of the list just read the comments in this file.
same deal with changing the element number.

give a sec and i will put together one to store to a list.

zlist.z80:

.NOLIST
#define equ .equ
#define EQU .equ
#define end .end
#include "ti83asm.inc"
#include "tokens.inc"
.LIST

_errundefined .equ 467Bh

.org 9327h

     call _zerooop1         ; clear op1
     ld hl,listname         ; where to copy name from
     ld de,op1              ; where to copy name to
     ld bc,6                ; length of name
     ldir                   ; all set, copy it
     call _chkfindsym       ; look up list
     jp c,_errundefined     ; error if not found
     ld hl,1                ; # of element to get (1-999)
     call _getltoop1        ; look it up
                            ; op1 contains the element's value

     ld a,16                ; format number for display
     call _formreal         ;
     ld hl,16               ;
     sbc hl,bc              ;
     ld a,l                 ;
     ld (curcol),a          ;
     ld hl,op3              ;
     call _puts             ; and finally display it!
     ret

listname:

     .db $01,$5D,"IAN",$00  ; the user list IAN

; notes:
;
;  1) if the list name is 5 chars long it
;     doesn't need to be 0 terminated
;
;      less than 5 chars:
;      list IAN would be    $01,$5D,"IAN",$00
;
;      5 chars:
;      list HELLO would be  $01,$5D,"HELLO"
;
;  2) for L1 - L6 use this format
;     $01,$5D,# of list
;
;      L1 would be  $01,$5D,$01
;      L2 would be  $01,$5D,$02
;      L3 would be  $01,$5D,$03
;      L4 would be  $01,$5D,$04
;      L5 would be  $01,$5D,$05
;      L6 would be  $01,$5D,$06

.end
END


References: