Thank you very much, turns out my script was wrong, now I just have to do this for all the rest of the HM's, thank you again! If you have any other advice I'd love some. :3
Basically, ASM is a file type for a Program written in Assembly Language! It was first made around the 60s or something, and was used in the more "basic" environment of Computers. The skill behind it comes from knowing how to think like a Basic Machine would, and remove any other clutter from higher level languages. I'm not sure how it's used in ROM Hacking, or WHY it even is used for ROM Hacks as it's usually not used for that from 1980s to now.
There's a simple Architecture they teach in most Schools today, where it has the CPU, the Memory, and the Devices. Imagine them all as Rectangles in a drawing in a Triangle shape, connected by another Square in the middle called the Bus! The Bus is also called the System Bus, or you can call it a Master Bus. Basically the 3 Sub Buses of Address Bus, Control Bus, and Data Bus are all used with the System Bus to relay Data back and forth between the 3. The Address Bus will determine what the Address is of each Byte of Memory! Addresses depending on the CPU architecture, can range from being relatively massive to just plain GIGANTIC numbers (which makes sense, given how much Data is on the Machine).
So essentially, all of the Instructions that are being computed by the CPU are being stored in the Console's RAM, a section of the Memory Board that is erased every time the device powers off. The core BIOS of the Machine that are used to start up the Console's OS (it's not OS like you know it as in the Desktop Computer world, with a big logo saying "Windows XP" or something) are stored in the ROM of the Memory Board. The ROM is not erased ever, and if it is, you can have trouble booting your Machine. What the Emulator does is, it tries to make a Virtual version of these components to be all ran condensed into 1 Emulator Application!
That being said, the Instructions you write in an Assembly program are all converted into Binary, which is then interpreted by the CPU. It will store the Instructions used for the Game on a type of "Hard Drive" in the Cartridge, which would be written in a more Human language. Then they are sent to the RAM of the Console through the Electrical Pins inside the Slot, and it will execute each Instruction smoothly; generating a nice boot-up logo and all! However often times it's just standard to use Hexadecimal instead of Binary, with Decimal being the normal Number Set we use of 0 to 9. As in, we can make 10 by mixing 1 and 0, 11 with 1 and 1, etc. It's only just 10 numbers repeated. This is because of the Prefix "Dec", and with Binary, it uses "Bi", Hexa uses "Hex" for 16; essentially giving you 16 characters that loop. So when you start at 0 and get to 9, you instead make 10 into an A, 11 into B, 12 is C, 13 is D, 14 is E, and 15 is F! That's why to say 15 in Hex, you just write "F".
Any time you see a "0x" followed by some type of code as you showed above, that is an old way of noting in an Assembly Program that you are using Hexadecimal numbers. Another way might be to add the letter "h" at the end, depending on what this System uses. However as to this "setflag" command I couldn't tell you, as I don't know the languages these Pokemon games use. Usually a Flag refers to something else, it's in the subject of Control Flags. Not the type of thing that would have so many values like it seems to in this case, it was originally only 16 and under Control Flags that were used to determine things.
Hope this helps a tad! :P