http://calcg.org/newlogo2.png Not Logged in.
Login | Register

General Discussion Board \ Calculator Programming \ Help with ASM

Click here to log in (you must be logged in to post comments).

AuthorComment
Socks
Probe
Posted: 1 Mar 2008
18:34 GMT
Total Posts: 5
I'm using the "Learn TI-83 Plus Assembly in 28 Days" tutorial to learn assembly, but on the first program, when compiling, I get the screen:

c:\asm\source\hello.z80 line 0007: unrecognized instruction. (B_CALL(_C
LRLCDFULL))
c:\asm\source\hello.z80 line 0011: unrecognized instruction. (B_CALL(_P
UTS))
c:\asm\source\hello.z80 line 0012: unrecognized instruction. (B_CALL(_N
EWLINE))

I think the problem is with the ti83plus.inc file, but I've tried three version without success - does anybody know how to fix it or where to get the version compatable with the tutorial?

---
Revenge is a dish best served cold... Just like ice cream!
BrandonW
Goliath
Posted: 4 Mar 2008
04:41 GMT
Total Posts: 100
It doesn't understand what B_CALL means because it's not defined anywhere. In your ti83plus.inc file, look for something like:

#define B_CALL(xxxx) rst 28h \ .dw xxxx

If it's not there, put it there, or if it is there (likely as BCALL, not B_CALL), use that way instead.

Is this ZDS or TASM you're using? ZDS deals with it a little differently, but what I just said is for TASM.
Socks
Probe
Posted: 4 Mar 2008
14:40 GMT
Total Posts: 5
Tasm - I just downloaded what came with the tutorial to start, for simplicity.

Going to try it.
EDIT: It worked! Thanks!

---
Revenge is a dish best served cold... Just like ice cream!
zarg
Dragoon
avatar
Posted: 29 Apr 2008
13:24 GMT
Total Posts: 67
I apologize for this bump ahead of time.
I have this same problem. Could you please go into more detail about how you fixed your problem. Thanks.

---
In most countries selling harmful things like drugs is punishable. Then howcome people can sell Microsoft software and go unpunished? (By hasku@rost.abo.fi, Hasse Skrifvars http://www.linuxweb.com/lw_quotes.html)
haveacalc
Guardian
avatar
Posted: 29 Apr 2008
16:19 GMT
Total Posts: 1111
If you programmed in hex opcodes, you would do ROM calls with "EF," followed by the 16-bit address. The Z80 processor has has 8 restart instructions: rst 00, rst 08, rst 10, rst 18, rst 20, rst 28, rst 30, and rst 38 (those numbers are hexadecimal, not decimal). rst 28h means B_CALL to us calculator programmers, but on other Z80 platforms. such as the Nintendo Entertainment System, it can mean something completely different. TI has set up the "rst 28" to, upon being processed, take the two bytes after it as an argument for a ROM call. The assembler that you're trying to program with is used to replacing "rst 28h" with "EF" upon assembling the program. What you're trying to do is put something else up that's easier to look at than "rst 28": B_CALL.

So, in short, B_CALL(XXxx) is replaced by rst 28 \ .dw XXxx which is then replaced by "EFxxXX" (little endian). rst 28 \ .dw XXxx is automatically replaced by "EFxxXX". By inserting the line of code suggested by Brandon into ti83plus.inc, you're telling the assembler to complete this process. If you don't understand what I just said or are lazy, just use this thing in the future instead (but change the file extension to .inc).

---
-quoted directly from most movies that don't exist (and some that do).
zarg
Dragoon
avatar
Posted: 29 Apr 2008
17:14 GMT
Total Posts: 67
Ok. I kind of get what your saying. Does that mean that B_CALL is an alias for rst28h. If so does that mean that I have to change B_CALL to whatever the compiler is use to the alias of rst28?

alias - From what I am use too it meaning another name for a comand that you can substitue in. The only use I saw them for is so during a lesson the teachers could alias the text message comand. We all found ways around that, but is that what alias means? By the way, I think I used that comand on a linix computer.

P.S. Why is the alias of rst28 B_CALL

P.S.S I changed the B_CALL in my ASM program to BCALL like Brandon said to try, and it worked. Thanks. I would also like to understand some more about all this. It's really confusing to me.

P.S.S.S What was that link you have and what is it used for?

Thanks for everything.

Edit: One more(Sorry). What(in easer terms for me to understand) does the B_Call(rst28) used for?

Thanks for everything.

---
In most countries selling harmful things like drugs is punishable. Then howcome people can sell Microsoft software and go unpunished? (By hasku@rost.abo.fi, Hasse Skrifvars http://www.linuxweb.com/lw_quotes.html)
haveacalc
Guardian
avatar
Posted: 29 Apr 2008
19:18 GMT
Total Posts: 1111
My apologies for writing "rst 28h"; the "h" is superfluous because "28" is already understood to be in hexadecimal.

Don't use "rst 28" and "B_CALL" interchangeably, because they're not the same. A B_CALL is routed through the instruction rst 28, but you'll never see the reverse. To understand their relationship, I present an analogy.

Assume that the universe uses the Z80 processor. Different elements are like Z80 instructions, unable to be simplified any further. And... the element mercury is like rst 28. Now, mercury is useful for a great deal of things. With it you can taint an oceanful of fish, chemically disrupt one's brain upon repeated fume exposure, or make money on Ebay from selling it. Consider a thermometer to be like Z80 graphing calculator, because it uses mercury for a specific purpose. In the thermometer, mercury (rst 28) is used for temperature readings (B_CALL), but not anywhere else. That's it.

A ROM call, denoted using "B_CALL", executes a (usually) useful block of instructions, pre-coded by TI. Here's a list of most of the documented ones, if not all.

ti83plus.inc is where all of the equates for manifest constants used for assembler-based Z80 Assembly programming are stored. I highly recommend that you visit TI's developer's resources page for any other questions that you have, until you understand more. If you are familiar with even a simple programming language like TI-BASIC, I have faith in the fact that you can learn all of the concepts of assembly from the TI-83 Plus Developer Guide (linked to on TI's page).

---
-quoted directly from most movies that don't exist (and some that do).
zarg
Dragoon
avatar
Posted: 30 Apr 2008
13:11 GMT
Total Posts: 67
Thanks. I'll try to learn all I can form that guide.

By the way,
I love your analogy.

Thanks

---
In most countries selling harmful things like drugs is punishable. Then howcome people can sell Microsoft software and go unpunished? (By hasku@rost.abo.fi, Hasse Skrifvars http://www.linuxweb.com/lw_quotes.html)





Portal | My Account | Register | Lost Password or Username | TOS | Disclaimer | Help | Site Search | File Archives Copyright © 2002-2019 CalcG.org