[Ti-ASM] My ASM Projects so far

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

[Ti-ASM] My ASM Projects so far

Post by Liazon »

My projects site

Soooooo.... I've been learning ASM for a little over two weeks now and here's what I've written so far. Can anyone help me check if I got all the syntax right? I think sytax might be okay, but the programs aren't fully optimized.

If anyone helps, that'd be awesome! THANKS!
Image Image Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

I think that maybe a Chess game might be a bit much for someone who is only just starting out with ASM. It would be a good idea to read through as many tutorials as you can and make a heap of little programs that do things such as displaying strings, working with arrays, simple graphics, sprites and the like. Once you have those things down making games will be a lot easier.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

The first thing you make should be so simple that it isn't fun. It should just be to apply basic elements of gameplay and graphics. Make a snake game where the snake doesn't get longer, make a WFRNG game, make a crappy game. Then move on to better things.
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

so do most of you guys have these (sub)routines that you've made personally, and now use in almost every program? Like have guys developed your own engines?

btw, i'm starting to feel like a joke in the TiASM Programming community
Image Image Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Don't worry, most of the ASM gurus are very harsh people (:P) but just learn from them and you will get better.

As for subroutines, I use pretty much the same D.I. routine in my programs. For my tilemapping programs, I use Dan E's tilemapper that he forgot he wrote. I also modified it to make a smooth scrolling one. Also, I cannibalized ion's putSprite and re-wrote it for masking purpose. Pretty soon I will follow tr1p1ea's lead and read external data from archived programs, but I will write that method myself according to his algorithm. Heh, it will probably be slower than his too. But the best thing to do in any game is to write a new engine for each one. That way you can apply the new things you've learned and hopefully make a smaller and faster program.
Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

You are far from a joke calcul831415, although i was a bit shocked by some parts of your code, i think its great that you are eager to learn ASM. There dont seem to be many people diving in lately.

You should have seen some of the things that i was trying to do when i started out ... sheesh! I am glad that no-one really saw any of my early code ... its embarassing ;). The thing is though, almost everyone is guilty :D.

The most IMPORTANT advice i can give you is to just start small. Trying to accomplish things which are too complex will only lead to frustration. Just chip away at it slowly, brick by brick. When you have all of the bricks ready ... then you can start building your monument.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

calcul831415 wrote:so do most of you guys have these (sub)routines that you've made personally, and now use in almost every program? Like have guys developed your own engines?
I don't. Since my programs are all entirely different, only the most elementary routines can be reused: maths, input and possibly low-level data retrieval. The rest is too specific to copy elsewhere. And frankly, I don't really like when complete engines are reused, it feels like having the same program twice.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

:( don't yell at me guys, but i've got moreprojects... that i still can't compile. Maybe I'll try Digitan's TASM v3.1 over Thanksgiving, but I wanted to show my friendsthisbefore break, provided it works.

Can somebody compile it for me (if it works, i remember how you guys were on my case last time) and email it back to me?

Thanks a bunch!!
Image Image Image
lloydkirk1989
Calc Wizard
Posts: 680
Joined: Wed 22 Dec, 2004 5:37 am
Location: West Palm Beach,FL
Contact:

Post by lloydkirk1989 »

calcul83145: I wouldn't recommend programming any more in asm until you can actually compile it. Looking at some of your source code, it looks like your missing some important concepts. I would recommend getting a better grasp of asm in 28 days before moving on. On that note, ben ryves is working on latenite, a z80 editor with compiler built in. If you're looking for something a little less beta, Calc King put together a great little z80 dev kit for use with the context editor, which can be downloaded here.
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

what concepts am I specifically missing?
Image Image Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

First mistake I saw was the you didn't include the underscore in front of one of the clrlcdfull. You are loading a into turkeypos when I think you meant to do hl. Don't do gbufcopy until you've copied EVERYTHING to the screen, right now you will show up then the turkey will instead of both "instantly". Also, I would recommend using ion's fastCopy instead of the bcall. After calling Turkey up, the a register may have been messed up, so it may end up calling the next calls as well. I think penrow has no underscore and is all lowercase. I also don't think you can load into the l register directly, only with numbers and other registers, but I could be wrong about that. Also, you left in several words like "neg" or "getkey". However that looks like my first ASM program, right down to the cps following calls.
Image
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

okay, so I finally compiled on my comp! Thanks guys!

anyways, the problems were that TASM got angry at me for using both ION and Ti83plus.inc so I got rid of the Ti83plus include file and defined what I needed that wasn't in IOn.inc

then I learned that you can't directly load into registers other than a. You have to do:
ld a,(variable)
ld b,a
to get the value at that address into b.

Then I made the corrections that Threefingeredguy mentioned above. I haven't gotten a chance to test it yet, but hopefully I'll be able to do that soon.

Now that I can finally compile, maybe I can start working on bigger projects.

@threefingeredguy: what did you mean"however that looks like my first ASM program, right down to the cps following calls"? is doing:
cp 2
call nz,label
a bad thing? Does it slow down the calc cuz you put something on the stack before making the call?
Image Image Image
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

calcul831415 wrote:okay, so I finally compiled on my comp! Thanks guys!

anyways, the problems were that TASM got angry at me for using both ION and Ti83plus.inc so I got rid of the Ti83plus include file and defined what I needed that wasn't in IOn.inc
I think it's better to use the real ti83plus.inc (so it's always up to date) and a tiny ion.inc that only contains the Ion functions. Whatever works for you, I guess. :)
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

oh god! now I just hope I don't have compiling problems for the Ti-89 Titanium I got for b-day! I don't even know what I need.
Final code for 1st z80 ASM game. It really doesn't look like a turkey does it?
Image Image Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

cp 2
call nz,label
a bad thing? Does it slow down the calc cuz you put something on the stack before making the call?
The only thing that's put on the stack there is during the call, and all that does is push PC+3. Stacks won't slow it down one bit, that's just a simple operation for the cpu!
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
Post Reply