A83: Numeric Input


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

A83: Numeric Input




> love/hate relationship with because he knew ASM, and you guys didn't

Oh, Wes...be careful there :)

Here's the tutorial:

#>$+K
Tutorial 34: ASM Input (Numerical)
Numbers and Equations.
Introduction.
Ok, this is like previous tutorial, but you load ASM_IND_CALL with 1
instead of 0.  And the display code is a helluva lot easier :)…This code
will ask for numerical input, so you could use this code in perhaps more
mathematical programs.  This program can handle integers, equations, real
numbers, tokens, the works!

New Commands
	_formdisp	- Displays the contents of OP1.

Code.
Very much like the last program.
...yep, same start...
.LIST

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
.end

Try these:  7, 7-2, 3X-2 (Put a value in X beforehand), 3.14159, sin(0.5).

Conclusion.
Yet another great discovery by the Almighty Linus…

Ok, just a quick look ahead.  To top off this tutorial, we'll look at how
to parse an expression in Y1, a look at detecting, protecting and
unprotecting programs.  Then on to a few short games related topics.  Some
of the tutorials will cover half of the job, you might have to cover the
other half.  That's the problem with game programming, its such a broad
topic that I can't make tutorials to cover all aspects of gaming.  Thus,
I'll keep the topics general and generic…I can always go more specific in
later releases if people think that's necessary (mind you, with the amount
of mail I get concerning my tutorials (2 entire mails since edition 1 was
released!!) I doubt I'll find out…).