A83: What's your name?


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

A83: What's your name?




He-he...check this out.  The input works great...the display string was
missing something small...but vital.  An increment :)

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

PGMIO_EXEC         equ           50B2h

.org 9327h

	call	_clrLCDFull
        ld      de,821ch                ;put the prompt here
        ld      hl,prompt
        ld      bc,16                   ;length of prompt, max = 16
        ldir

        ld      a,0                     ;code for STRING input
        ld      (ASM_IND_CALL),a
        call    PGMIO_EXEC              ;defined in squish.inc
        call    _CHKFINDSYM

	push	bc
	push	de
	push	hl
	call	_clrLCDFull
	call	_homeup
	ld	hl,Yourname
	call 	_puts
	call	_newline
	pop	hl
	pop	de
	pop	bc

        ex      de,hl                   ;hl is start of string data
        ld      c,(hl)
        inc     hl
        ld      b,(hl)
        inc     hl                      ;bc is length of string

        ld      a,b
        or      c                       ;length = 0 ?
        ret     z                       ;return if so

loop:
        push    bc
        ld      a,(hl)                  ;get a character
        call    _putc
        pop     bc
        dec     bc
        ld      a,b
        or      c                       ;done yet?
        inc  hl			;MISSED THIS OUT, LINUS
        jr      nz,loop                 ;no -> loop back

        call    _newline
        ret

prompt:         .db "Name: ",0
yourname:	.db "Your name is",0

.end
.end

---------------------------------------------

Hope this helps you guys.

James.


Follow-Ups: