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

General Discussion Board \ Calculator Programming \ ASM basics

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

AuthorComment
banjo2E
Wraith
avatar
Posted: 14 May 2007
05:55 GMT
Total Posts: 689
I'm considering making my next game in an ASM language, because it'd be a lot less hassle...probably...to use ASM for it. However, I have never used ASM, and the one time I tried all I got for instructions was a stupid tutorial to make ONE GAME. Pong, if you can believe it.

So, any good ASM programs out there, and any lists out there that show what individual lines of code do? I'd prefer a list to a crappy "tutorial" that you can't learn from any day.

---
http://uncyclopedia.org/wiki/User:Administrator <------ WOOOOO!!!!!
haveacalc
Guardian
avatar
Posted: 14 May 2007
09:16 GMT
Total Posts: 1111
There's instruction documentation here, within ASM in 28 Days, and at http://www.z80.info. Keep in mind that the last one isn't calculator-oriented in any way, so you'll have to learn some calc-specific things in order to be successful.

The difficulty of making your next game in Assembly depends on your definition of "hassle". Since each line of code does much less than in TI-BASIC, you might have trouble keeping track of things. For me, oncalc hex is very easy to keep track of, since I can have as many instructions (and data) as I want on a single line.

---
-quoted directly from most movies that don't exist (and some that do).
banjo2E
Wraith
avatar
Posted: 14 May 2007
11:08 GMT
Total Posts: 689
I prefer keeping individual lines of code on different lines. It's easier for me that way. Still, I'll try those sites later; I doubt my school allows them, so I can't now.

---
http://uncyclopedia.org/wiki/User:Administrator <------ WOOOOO!!!!!
haveacalc
Guardian
avatar
Posted: 14 May 2007
15:38 GMT
Total Posts: 1111
I don't think you can put multiple instructions on one line using an assembler.

---
-quoted directly from most movies that don't exist (and some that do).
me2
Goliath
avatar
Posted: 24 May 2007
18:01 GMT
Total Posts: 171
I think he's talking about BASIC

---
<--- Going out with a bang.
threefingeredguy
Ghost
avatar
Posted: 26 May 2007
17:50 GMT
Total Posts: 1189
You can use a \ to put multiple commands on one line in asm.

---
Someone call for an exterminator?
mechatech84
Dragoon
avatar
Posted: 31 May 2007
15:18 GMT
Total Posts: 96
as much as I hate to sound like a stupider version of a noob..... What in the world is on calc hex??????

and why haven't I heard of it before..... hmmmmmmm......

-Mecha....

PS. I Have RETURNED...... MUHAHAHAHAHAHAHAHAHAHA.... HAHAHA... HA!!!

---
My personal (unofficial) records on 3x3x3 Rubik's Cube: regular-24.06 sec, one-hand-50.67, with feet-5:40, number of people taught (in person)-at least 15.
haveacalc
Guardian
avatar
Posted: 31 May 2007
15:33 GMT
Total Posts: 1111
Hello, you. Basically, each assembly instruction ever possible can be represented as a number (an opcode). For example, "ld a,5" can be represented in hexadecimal as 3E05, and "B_CALL(_GetCSC)" can be associated with EF1840. So, a simple program on the calculator that loops until a key is pressed and returns could be this:
AsmPrgm
EF1840B728FAC9
You'd type that program into an empty program, just like you would a TI-BASIC one. Then, you'd run it using Asm(.

Coding goes much faster (given you're familiar with the 1000+ opcodes, like me) than if you were typing things into a text file on the computer to be assembled. Testing is also much more direct and faster, since the whole program's right there on the calc. The drawbacks are:

1. For jumps, relative jumps, and calls, you have to count everything out, byte by byte.
2. Unless you want to go back and forth with the decimal system, you have to do mental math in hexadecimal, since you can't work with any other base.
3. You have to back everything up every time you test a program, just in case it crashes.
4. You risk killing your calc if you don't test things using an emulator. I killed mine (two of them now), so I have to be careful.
5. Debugging completely sucks because all the opcodes are very condensed when you look at them together, even when you use line breaks.

---
-quoted directly from most movies that don't exist (and some that do).
mechatech84
Dragoon
avatar
Posted: 31 May 2007
15:45 GMT
Total Posts: 96
so i would still have to know how to program in asm to be able to do that? hmmmm..... I asked because the main reason I decided not to take the time to learn asm is because i generally program when I get bored in class..... since today was the last day of school though, i might be interested in learning..... how do I figure out the opcodes? and also, in oncalc hex, does it get easier to read the code after time? or will I have to decode everything one statement at a time? man, if this works for me, it will surely confuse people trying to figure out what i'm programming!

---
My personal (unofficial) records on 3x3x3 Rubik's Cube: regular-24.06 sec, one-hand-50.67, with feet-5:40, number of people taught (in person)-at least 15.
haveacalc
Guardian
avatar
Posted: 31 May 2007
15:54 GMT
Total Posts: 1111
The first thing to do is to memorize all the opcodes. As you memorize them, learn the exact functions of the instructions that they represent. I enjoyed programming in Assembly during class, but you should probably only do it this way if you're really good at memorizing things.

But yeah, it gets a lot easier and faster over time. I've taught people to glare at me when I try to show them the source for the things that I make nowadays.

---
-quoted directly from most movies that don't exist (and some that do).
mechatech84
Dragoon
avatar
Posted: 31 May 2007
15:55 GMT
Total Posts: 96
how do i find all the opcodes?


---
My personal (unofficial) records on 3x3x3 Rubik's Cube: regular-24.06 sec, one-hand-50.67, with feet-5:40, number of people taught (in person)-at least 15.
haveacalc
Guardian
avatar
Posted: 31 May 2007
15:58 GMT
Total Posts: 1111
There are plenty of lists of opcodes under text/z80 at ticalc. Personally, I like this one more than the rest because it's organized in a way that you can find the patterns to memorize everything by.

Edit: Whoops, wrong URL. :)

---
-quoted directly from most movies that don't exist (and some that do).
mechatech84
Dragoon
avatar
Posted: 31 May 2007
16:00 GMT
Total Posts: 96
nice link =P..... and thanks for all the help, I gotta go now but I might be on tommorrow or later..... I'll be sure to check that out though! sounds very appealing......

---
My personal (unofficial) records on 3x3x3 Rubik's Cube: regular-24.06 sec, one-hand-50.67, with feet-5:40, number of people taught (in person)-at least 15.
banjo2E
Wraith
avatar
Posted: 1 Jun 2007
05:37 GMT
Total Posts: 689
Lemme guess. Pr0n-tastic meals from Red Lobster?

---
http://uncyclopedia.org/wiki/User:Administrator <------ WOOOOO!!!!!
haveacalc
Guardian
avatar
Posted: 1 Jun 2007
07:13 GMT
Total Posts: 1111
To memorize all the opcodes, I told Excel to print it on 2 pages, changed the setup to landscape, and printed a double-sided paper that I carried around in my pocket for a while. Be careful not to memorize what you don't understand, though.

---
-quoted directly from most movies that don't exist (and some that do).





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