A86: a few questions that I have


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

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