I've left it here because I thought it was the most appropriate place, rather than in one of the sub-forums.
Just a note to those who may have stumbled in here by accident: ZASM (as it appears to me) is only really included as a way for ZScript to be linked to ZC's internal code.
By all means have a go at trying to use it, but you're unlikely to get any help as almost all scripts for Zelda Classic are written in our C-based ZScript.
AGN is very likely to be a better place to get help than here with regards to ZASM.
For help learning ZScript, check the sub-forums.
~Joe123
Alright. I'm going to give a tutorial on Zasm (To the best of my ability, I haven't exactly mastered it yet myself). There is quite a bit more than this, but here are the basics...
EDIT: I guess I should explain what Zasm is and how it is used then :P
Zasm scripts are used to move FFCs (and do some other things) in special ways that you can't do with changer combos. A Zasm script is a TXT file that is imported using Data->Import FFC script. Scripts can be used to do many things, from chaser traps to full-fledged custom bosses.
Structure:
A Zasm script has labels and functions. A label has no space in front of it, a function has a space in front of it. Like so...
GOTO WAIT
The label WAIT has no space, telling the compiler that it is a label. You put a space next to the label and put a function next to taht. You must use only one function per line.
SETV D0,1
GOTO WAIT
Like so. After the function goes a space, with the arguments after that. Each function other than WAITFRAME (stops executing lines until the next frame starts, quite useful for timers and the such) and QUIT (ends the script) has arguments. Arguments are seperated by a comma (,). Now for functions...
GOTO sends it to the label after GOTO. So GOTO WAIT would send the execution to the label WAIT.
COMPAREV compares a register with a number. COMPARER compares the first register to the second register. An important note is that if the last letter of a function is V, that means that the first argument is a register and the second is a number. If the laster letter is R, that means that both are registers.
After COMPAREV or COMPARER, you put another function (or multiple functions, you can use as many as you want for each COMPARE, as long as you want the same values to be compared each time). Here they are...
GOTOTRUE goes to the label if both values are equal.
GOTOFALSE goes to the label if the values are not equal.
GOTOLESS goes to the label if the first value is less than the second value.
GOTOMORE goes to the label if the first value is greater than or equal to (which I find really weird) the second value.
Now for some other functions that just do math. For the R functions, the first one is the register being changed, and the second register is from where the value is being taken from.
SETR Sets the register to a value
SETV
ADDR Adds the second one to the first one
ADDV
SUBR Subtracts the second value from the first one
SUBV
MULTR Multiplies both
MULTV
DIVR Divides teh first one by the second one.
DIVV
ANDR Not sure...
ANDV
ORR Also not sure... (if anyone knows, can they please tell me?)
ORV
XORR Exponents. The first register ^ the second one.
XORV
Now, for variables. Here are a few basic ones to get you started:
x The FFC's x position on the screen.
y The Y position of the FFC
linkx Link's X position
linky Link's Y position
xd The FFC's x speed
yd The FFC's y speed
Ax The FFC's X acceleration
Ay the FFC's Y acceleration
INPUTUP/DOWN/LEFT/RIGHT/START/A/B wether or not (1 if pressed, 0 if not) the button is pressed.
^ Of course, there are many more hard-coded variables, but those are the ones that you will see in practically every script. Every last variable can be read from and written to. Meaning that you can change and call from every last one of them, making Zasm very, very flexible.
Now, with what we have learned, let's make a script, shall we?
COMPAREV INPUTUP,1
GOTOTRUE UP
COMPAREV INPUTDOWN,1
GOTOTRUE DOWN
COMPAREV INPUTLEFT,1
GOTOTRUE LEFT
COMPAREV INPUTRIGHT,1
GOTOTRUE RIGHT
GOTO WAITFRAME
UP SETV y,-1
GOTO WAIT
DOWN SETV y,1
GOTO WAIT
LEFT SETV x,-1
GOTO WAIT
RIGHT SETV x,1
GOTO WAIT
Now, what will this script do? It will move the FFC around using the 4 directional keys.
Here's another trick: random values.
RNDV and RNDR set the first argument as a random number (the infinite number of decimals inbetween included) between 0 and the second argument. You can say, use RNDV x,240 to place the FFC on a random spot on the screen horizontally. That works fine and all, but say you want the minimum value to be something other than 0? Here's how you do it...
MULTV d0,5
ADDV d0,5
That code sets the register d0 to a random value between 5 and 10. Why? Lemme explain how it works.
RNDV d0,1
This sets d0 to a random value between 0 and 1.
MULTV d0,5
This multiplies whatever value came out by 5. That way, if the value is 0.5, it will now be 2.5
ADDV d0,5
This adds 5 to what just came out. So now, 2.5 becomes 7.5, a value between 5 and 10. Using this, you can plug any value in you want as the random number (as long as it is between 0 and 1, and is not 0, as RNDV/R will never give you 0) and you will always get a number between 5 and 10. So this is how it works...
MULTV d0,(minimum value)
ADDV d0,(The minimum value you want subtracted from the maximum value)
To set min/max values and get a random number. Have fun.
(Credits to Saffith, who taught me pretty much everything I know about Zasm)
I will be editing this post to include more as I write it, and feel free to ask me any questions you want, and I will answer them for you.
Also, I personally think this topic denotes a sticky ;)