A86: Re: a few questions that I have
[Prev][Next][Index][Thread]
A86: Re: a few questions that I have
I would recommend against studying floating point math programs such as
ZDist and ZReduce, as OP registers can be confusing when you are starting.
I actually think it is easier to write games in asm than math programs, but
maybe that's just me.
What version of tic tac toe are you looking at? I really hope it isn't
mine, I wrote that in the first 4 days I really learned asm, so the code is
very bad. But if you want some commented, beginner code, that's it...
The reason it doesn't show the title screen is that you have zero-byte
terminating each string. If you want to do a title screen like that, just
put a zero after the last string. The zero byte (the ,0) makes the string a
"zero-terminated" string, meaning an actual byte value of 0 terminates the
string. This tells _puts to stop putting (quote from Jimmy Mardell's DispHL
routine). _puts prints a string until it reaches an actual 0, not a '0' (48
decimal) in the string. The text, or your title screen, will wrap for the
whole screen:
ld hl,text
call _puts
ret
text:
.db "123546789012345678901"
.db " This text just"
.db "wrapped across all of"
.db "these lines...",0
You might want to include a call to _flushallmenus at the start as well, or
will run into trouble if they run it from the home screen. My mailer is
searching for the flag to prevent "Done" from appearing, but it takes a
while to search through 5000-10000 messages. ;-) I'll post it when I find
it.
On an irrelevant note, it really helps to use a mono-spaced font in your
mailer, like Courier New.
--
David Phillips <electrum@tfs.net>
ICQ: 13811951
AOL/AIM: Electrum32
86 Central: http://www.tfs.net/~electrum/
-----Original Message-----
From: Cheetah17@aol.com <Cheetah17@aol.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Tuesday, October 27, 1998 10:15 PM
Subject: A86: a few questions that I have
>
> OK, I'm trying to learn ASM, like I said in my last post, and so far I
have
>read over Matt Johnson's tutorial, Dux Gregis's tutorial, and the source
codes
>for ZReduce, ZDist, and Tic Tac Toe. I don't know why I chose those (except
>that I want to convert my BASIC TI-Tac Toe to ASM once I finish the program
>and once I get the hang of ASM, but...), but I did. There was one command
in
>particular (cp) that I saw in a bunch of places but never found a
syntactical
>(is that a word?) explanation of, in either tutorial, although it was used
in
>some examples. What exactly does it do? I think it's some kind of If thing,
>but I'm not completely sure.
> Also, for my first assembly program, I wrote a "TI-86 Emulator", which
>displays the title screen, waits for a keypress, and exits :-). Except that
>the title screen won't show. There's only a clear screen and then when you
>press a button it exits. Can you figure our what's wrong? And is there some
>trick in assembly to keep that "Done" from showing when a program exits? I
>only know that you put Outpt(1,1,"" at the end of a program in BASIC to
keep
>"Done" from showing. Here's the code (ouch, Arial really messes up the
>spacing...):
>
>;-----Begin Code-------------
>#include "ti86asm.inc"
>
>.org _asm_exec_ram
>
> call _runindicoff ;turn off the run indicator
> call _clrLCD ;clear the screen
> ld hl,$0000 ;load $0000 into hl
> ld (_curRow),hl ;load 0,0 as the cursor location
> ld hl, title_screen ;make hl point to the title screen
> call _puts ;display the title screen
> call _getkey ;wait for a keypress
> call _clrLCD ;clear the screen again
> ret ;begin home screen emulation :-)
>
>title_screen:
> .db " ",0
> .db "---------------------",0
> .db "*TI-86 Emulator v1.0*",0
> .db "---------------------",0
> .db " ",0
> .db " by Adam B. Newhouse ",0
> .db " ",0
> .db " press any key ",0
>
>.end
>
>;------------End Code---------------
>
> Oh, and another thing. Why do you put ",0" at the end of things? I
noticed
>almost everybody did it and so I put it in too, but I'm not sure why. Maybe
>that's the problem. Oh well, I'll wait until I get a response to change
>anything else.
>
>--Adam Newhouse
> Cheetah17@aol.com