|
Post by Chris on Mar 24, 2002 13:33:11 GMT -5
what's wrong with registers? i'll tell u, THERE'S ONLY ABOUT 7 OF THEM, i need more than that, and also, they can't go that high cause they're only 1/2 bits, i REALLY want to know how to use 9 byte vars in asm
|
|
|
Post by Jbirk on Mar 29, 2002 3:31:31 GMT -5
I don't know how to use a 9 bit var.
BTW, registers are 8bits "can hold a max of 255"
you can double them up though example HL is a 16 bit pair.
You also have the stack
push HL Pop Hl
I recommend that you contact David L or Bob M
|
|
|
Post by Chris on Mar 30, 2002 11:00:03 GMT -5
sorry, i meant to type 9 byte, btw someone as skilled at asm as u should know that in asm there's no such thing as a 9 bit vars, because that would be 1 1/8 bytes which doesn't exactly work, also i already know about the stack, though sometimes it gives me problems and i only use it if i have to
|
|
|
Post by David L on Mar 30, 2002 14:33:17 GMT -5
For what would you be using the 9-byte variable for? It's common to use certain RAM areas for the storage of variables. The RAM area appbackupscreen is 768 bytes big, and should be enough for your needs.
To load HL with the two first bytes of the appbackupscreen: ld hl,(appbackupscreen)
And to write HL to the var:
ld (appbackupscreen),hl
|
|
|
Post by Chris on Mar 31, 2002 20:41:54 GMT -5
um...ok, can u list the area's that i can store the things in?
|
|
|
Post by David L on Apr 1, 2002 3:12:23 GMT -5
|
|
|
Post by Simucal on May 12, 2002 20:56:37 GMT -5
well, if you happened to be writing this program in ION all your problems would be solved.
For variables, just use user defined lables (custom varibles).
You can set them up as follows:
[varname = saferam2]
exp = saferam2 gil = saferam2 + 1 power = saferam2 + 3
saferam is a ION defined area of ram that is safe. If you wish to know what the memory addresses are of these open up ION.inc and check them out. That way you dont have to use ION if you dont want to.
About the random number, ION has a fast random number generator. You use it as follows (Straight from ION guru):
ionRandom: ionRandom is another simple routine that outputs a random number between zero (0) and a number you load into register b. Joe Wingbermuehle boasts that this little routine is much faster than the rom call _random, so I suggest using it. Heres the low-down:
Input: b=upper bound Output: a=answer (0<=a<b) b=0 Destroys af b
|
|
|
Post by Chris on May 13, 2002 10:33:53 GMT -5
i've sorta given up on asm for the moment, i'm busy working on red alert, helping a friend with a mud, and of course spending about 5 hours a day on AoW but i'm probably gonna start work on a MUCH simpler asm program, probably something like a little stick figure that moves around the screen, somethign that doesn't really have room for the unexplainable bugs i've been getting
|
|