A83: Re:


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

A83: Re:




On Mon, 17 May 1999 15:55:09 +1000, Cameron McCormack wrote:
>
>I notice people are using routines like _ParseInp and stuff which I've 
>never
>heard of before. I'm still just using the routines listed in TI's
>documentation -- is it just people have discovered these routines and not
>told everyone, or have I not been taking notice?
>
>I see also that I don't know some of the ASM_IND_CALL functions -- I just
>know it for the link routines.  I've seen though some people use them for
>getting input (like it was a Input "",Str1 or something).  Can anyone tell
>me these functions?
>
>Thanks
>Cameron
>

Here is a couple of bits from James Matthew's ASMGURU. I recommend you 
download this help file, as it's a must for all ASM programmers.

;you know what to put here..

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		;

jr     nz,loop		;no -> loop back
call   _newline
ret

prompt:        .db "Name: ",0

yourname:	.db "Your name is",0

.end


All tutorials Copyright (c) James Matthews 1998, unless specified.

This code will prompt for you name and then print it out. This next one asks 
for a number:

;same start again....

PGMIO_EXEC         equ           50B2h

_formDisp          equ           4D0Eh

.org 9327h

        ld      de,821ch

        ld      hl,prompt

        ld      bc,16

        ldir

        ld      a,1

        ld      (ASM_IND_CALL),a

        call    PGMIO_EXEC

        call    _formDisp

        ret

prompt:         .db "Num: ",0

.end

All tutorials Copyright (c) James Matthews 1998, unless specified.

Hope that helps you. Remember to download the ASMGURU file from:
http://www.dimension-ti.org/articles/index.html

See ya round,

James Vernon
jimbob_v@hotmail.com


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


Follow-Ups: