A86: Re: (none)


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

A86: Re: (none)




>I am trying to create my first assembly program, but when I try to
>compile it using tasm I get a bunch of errors.  If someone can tell >me 
what I am doing wrong, I would greatly appreciate it.  By the way, >the 
program is at the bottom of the letter.  

>asse2.txt line 0034: label value misalligned.           (JR)
>asse2.txt line 0034: unrecognized instruction.          (JR)
>asse2.txt line 0037: Label not found: (call)
>[...]

The problem with this is the arguments you are giving to TASM.
TASM stands for "Table Assembler"; a program which can assemble
for many processors by using one of the many instruction tables
available for it.  However, you have to tell it which processor
you're trying to assemble for.  For the Z-80, you put " -80"
on the command line after TASM.  You must also have the table
file "TASM80.TAB" for this to work.  If you use the Asm86 compiling 
utility, you only have to specify the source name to the MAKE86P
batch file, which will assemble the program and convert it to an
86P file.

By the way, there are a couple of problems in the code you put
below.  First, the instruction "jr Equal" will always jump,
regardless of the result of the previous compare instruction.
This will cause the program to display the "Access Denied"
message regardless of which key you press, which could lead to
a problem.  Also, you can't exit just by jumping to the end of
the program.  This will cause execution to continue after where
your code is.  Since you can't really be sure what will be there,
it is a very bad idea--the calculator is likely to crash as a
result.  You need to exit with the "RET" instruction.

>.include "ti-86.h"
>.org $D748
>
>call     _clrLCD
>
>GetLoop:
>call _getkey 
>cp kMode
>jr Equal
>cp kMem
>jr Equal
>cp kPrgm
>jr Equal
>cp kCustom
>jr Equal
>cp kLinkIO
>jr Equal
>cp kUp
>jr End
>
>Equal:
>call     _clrLCD
>ld       hl,0
>ld       ($c00f),hl
>ld       hl,title_message1
>call     _puts
>JR GetLoop
>
>End:
>call     _clrLCD
>ld       hl,0
>ld       ($c00f),hl
>ld       hl,title_message2
>call     _puts
>jr end2
>
>title_message1:                 
>         .db      "----------------------------"
>         .db      "|Permission Denied|"
>         .db      "----------------------------",0
>
>title_message2:                 
>         .db      "---------------"
>         .db      "|Good Bye|"
>         .db      "---------------",0
>
>end2: .end
>


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