;Anything after a semi-colon gets ignored by the assembler until the next line. This allows you to write "comments" in your code to explain what you are doing. Save the text in the blue square to a file, then use the file with fasm, then use the resulting file the same way you used the Learner Kernel sample.

;"include" followed by a path (google "file paths" if you don't understand) allows you to add another source file into your current source file to be interpreted as if it was also source code.


include "macros.inc"

;macros.inc holds all the macros that are necessary for the kernel.

begin

terminate ;This is actually what keeps the program from crashing. It stops the execution. Since anything after "end" cannot be predicted by us, we have to stop it to prevent the unpredictable (usually it just crashes). The reason for this is that the processor can't tell what part of the binary is for instructions and what part of the binary is to be used for remembering things. Some advanced programmers perform math operations on instructions to hide what they are. This is called "encryption." Anyway, that is a topic for another discussion. This program didn't crash, so we're on our way to victory.

end

;Oh, and one last thing. The number of spaces and newlines don't matter as long as there's at least one present. The assembler simply ignores the extra blank spaces.


Get your own web kitty here!
┬ęCopyright 2010, 2011, 2012, 2013, 2014, 2017. All rights reserved.