* -------------------------------------------------------------------------------------------- * | ChaoZers 98/04/26 | | Assembler Tutorial #02 | | -------------------------------------------------------------------------------------------- | | | Basic usage of Asm-One 1.20-1.30 & AsmPro | *----------------------------------------------------------------------------------------------* Introduction ------------ Isnt it frustrating that there is no good and easy guide that covers the most important aspects of AsmOne/AsmPro, and how to use them? (Not in a easy way anyway.) Thats why i am here, to help. This second tutorial of the assembler course will cover the usage of AsmOne/AsmPro, they are my absolutely favourite assemblers for 68K Amiga computers. For the ones out there that use cybergfx, i can say that AsmOne cant handle cgfx screens. Therefore, if you are a cybergfx user and want the assembler on a cgfx screen, i recommend AsmPro, which is an assembler built on AsmOne. So AsmPro and AsmOne are almost the same, although AsmPro supports the instructions in the 68060 that are new, and also cybergfx screens and more! Well then, lets begin with it :). First thing you will see ------------------------ Ok, When you boot up AsmOne/AsmPro for the very first time you are greeted with the "Allocate memory display". This is the memory that is supposed to be used during coding, as workmem. Well, generally, this means writing P or C or F on the prompt. I usually choose chip. C=Chip P=Public (Fast/Chip) F=Fast Ok, when this is done, you will have to enter how big the workspace is supposed to be, this is entered in KB. So if you write 1024 you take up one meg of mem as workspace for asmone. Normaly, i choose around 200-500KB. In AsmPro there is a GUI instead, but i think you understand how to use that! :) First thing to learn -------------------- Now you should get a small prompt where you can write things. Press enter, and AsmOne/AsmPro will clear the screen and put the prompt at the top of the display. If you now press ESC, AsmOne/AsmPro will jump into EDITOR mode, this is where you will write all your source code later. Press ESC again when you are in EDITOR mode, and AsmOne/AsmPro will return to the prompt. Lets check what you can do in editor mode... Editor Mode ----------- In here you write your source! You can have upto 10 different sources loaded into memory, to load a source just go back to the prompt by pressing ESC and write R. (Read) Now you can choose a source to load into AsmOne/AsmPro! If you want to save your source you also go back to the prompt, but then you write W (write). When in EDITOR mode you can switch between all the sources you have loaded by pressing F1-F10. You can also copy, cut, paste, search for strings, and much much more! For more info on the commands and their shortcuts, check out the menu bar when in EDITOR mode! Runing the code --------------- When you think your source is "completed" you can assemble and run it by going back to the prompt. Then you just write A (assemble) and after that J. When the execution of the program has been sucessfull you will get loads of values and stuff writen on screen. Theese are the data&intruction&fpu registers. And some other registers. We WILL talk more about theese in the next few turutorials, but not here. Debugger Mode ------------- You enter the DEBUGGER mode by pressing R-Amiga+D. (Or use the menu!) You can also write AD at the prompt. In DEBUGGER mode you can debugg your programs! Ehm... :). On your right side you see all the registers and can easily keep track of the values. You move forward in your program by using the cursor keys. You can do loads&loads of stuff in the DEBUGGER. For more info on the commands and their shortcuts, consult to the menu bar. The built-in Calculator ----------------------- The calculator can be reached at the prompt by writing "?". So if you want to check how much the decimal value 5+5 is in binary&hex form you write like this. ?5+5 When you write this AsmOne/AsmPro should return this string. 0000000A 10 "...." %00000000.00000000.00000000.00001010 Hexadecimal Decimal Binary See? Its very easy. I you want to use a hexadecimal or binary value you have to put the %,$ signs in front of the value. Here is an example. ?5+$A5+%00100101+12 The =R command -------------- This is a very handy thing... Its a command that shows the name of the register at the specified adress, heres an example! =r $dff080 (Then you get the COP1LCH&COP1LCL custom registers, and what they are.) If you want a more clear description i can tell you that it is the first copper adress. :) More about this in a future part of the turtorial. Some common commands -------------------- ZI - Zap Includes (Flush all the includes, so that the assembler has to reload them.) ZS - Zap Source (Kills the current source.) R - Read Source (Reads a source) W - Write Source (Saves a Source) WO - Write Object (Writes a executble file.) AD - Debugger (Assembled and enters debufgger mode) Important last note ------------------- Well, for the rest of the commands, and what they do, read the AsmOne/AsmPro guide. Excercises ---------- None available this time. Email&More ---------- Want to get in touch with me? My email is "chaozer@algonet.se". My homepage is at "http://www.algonet.se/~chaozer/" You can also find me on IRC, almost everywhere, under the nickname ChaoZer.