May 6, 2009 at 2:48 AM
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
I see you have left-shift (shl) on the list, but what about right-shift? Is that a separate command (eg shr), or can shl take a negative second operand?
I think this is incorrect; you probably want "divides x by 2^y"shr x,y -- divides x^y by two, rounding down. similar to shl
hl x,y -- multiples x by 2^y, a lot faster than mul.
shr x,y -- divides x by 2^y, rounding down. similar to shl
i.e. today, after my post, before yours.Last edited by dooey100; October 27th, 2009 at 04:49 PM
Lace said:without even posting?
what a sly old meany.
thanks for putting the art of assembly up, btw.
real helpful for people who tend to lose their resources (moi)
umm.... right click what???
right click on desktopisack55 said:umm.... right click what???
You mean this?dooey100 said:And to save your awesome new hack: right click and choose Copy to Executable, then choose all modifications. A window with 4 options will appear, choose Copy All, and then the main window will minimize and a new window will appear, close the new window and you will be given the option to save.
dooey100 said:Code:MOV EAX,[EBP+8] ; this line is created for a process called pipelining that make the code run faster. Also because of this, [EAX+14], [ECX+14], and [EDX+14] will always be the same thing, as long as [EBP+8] is in EAX, ECX, or EDX. Any line that puts [EBP+8] in a register is doing this, and you can condense these to gain space if you need to (this is more advanced) MOV ECX,[EAX+14] ; this line takes the number that is in [EAX+14] and puts it in ECX so that we can do stuff with it. In a higher level language, [EAX+14] would be called a variable. MOV EDX,[EBP+8] ; pipelining ADD ECX,[EDX+1C] ; this line adds whatever is in [EDX+1C] to ECX (which currently contains [EAX+14] from before) MOV EAX,[EBP+8] ; pipelining MOV [EAX+14],ECX ; this takes whatever is in ECX and moves it back to [EAX+14]
So the overall result of the above code is to add [EDX+1C] to [EAX+14]. Lets try changing that to see exactly what [EDX+1C] and [EAX+14] are. Try changing the line ADD ECX,[EDX+1C] to ADD ECX,5 and play cave story and shoot the polar star to see what happens. You should find that when you shoot it, it will rise (independent of whether or not it is moving horizontally) This tells us that [EAX+14] is the current y-position of the bullet! And since [EAX+1C] is added to it every frame, then it must be the vertical velocity of the bullet!