A83: Lists


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

A83: Lists




this one stores to lists. the number comes from op1, so it can be
floating point and/or negative. don't ask me how to store a floating
point number because i don't know the format.

note: do NOT store to an element that isn't created because it WILL
cause problems! make sure the list has the right dimensions using the
basic dim( command before you use this program!!!

compile this and send it to your calc. then type this into a new
program.

:1->dim(lIAN
:Send(9prgmZLIST
:lIAN

this makes sure list IAN exists and that it has the correct dimensions.
then it runs ZLIST which stores to element 1 in list IAN. then it
displays the new contents of list IAN.


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
     push de                ; save de
     ld hl,500              ; number to store to list
     call _setxxxxop2       ; put it in op2
     call _op1exop2         ; move it to op1
     pop de                 ; restore de
     ld hl,1                ; # of element to get (1-999)
     call _puttol           ; store 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: