Robert M Posted December 12, 2004 Share Posted December 12, 2004 Assembly Language Programming - Lesson 11 - Setting up DASM ========================================================== Alright, we have had 10 lessons of concepts with no programming in sight and I am sure some people are getting bored. The good news is we are just about ready to start writing code. In this lesson you will set up your development environment, compile a program I have provided, and run it in the emulator of your choice. The point of this lesson is to make sure we all have the same build setup so there is minimal confusion going forward. We have enough to worry about without having to deal with everyone using a different assembler or a different directory structure. Please note, that I do not require that you use Windows, Mac, Linux, Amiga or any specific system. Use what you have. You will have to understand your system enough so that when I say create a new directory/folder you know how to do it on your system. Setting up the directory structure: ----------------------------------- 1. Choose a folder or directory on your system to hold DASM and all of your lessons. 2. In your chosen folder/directory, create a new directory named "ALPstuff" which is short for Assembly Language Programming stuff. 3. Within "ALPstuff" create a new directory/folder called "lesson11" 4. Save the two files I have attached in zipped form to this post "vcs.h" and "lesson11.asm" into the lesson11 folder you made in step 3. PLEASE DO NOT CHANGE THE NAMES OF THESE FILES, SAVE THEM AS I HAVE LISTED. Thanks. 4a. People using Winzip remember to save my files I zipped with gzip with the .gz extension or Winzip won't know how to extract them. DASM - The assembler program: ----------------------------- DASM is the assembler program we will be using for all our lessons. An assembler is a program that takes one or more text files containing the instructions of a program in human-readable form along with some extra control commands, and converts that human-readable program into a machine-readable binary file. A program in binary form is sometimes said to be in Machine Language. Assembly language is the human-readable form of a machine language for a given processor. Different processors will have a different machine language requiring a different Assembly language. Recall in lesson 7 when I defined a state machine, one of the things a state machine has is an alphabet. A machine language program (an executable binary file) is a sequence of steps for the processor written using the alphabet of the processor seen as a state machine. The diagram below tries to show how an assembler fits into our scheme. text file: binary file: +--------------+ +-------------+ outputs +--------------+ +----------+ | | inputs | |===========>| lesson11.bin |= This the game ROM image. ==> | emulator | | lesson11.asm |==========>| Assembler | +--------------+ +----------+ | | | Program | text file: +--------------+ | | +--------------+ This is a human-readable version text file: | ( DASM ) |===========>| lesson11.lst | of the game ROM image listed in +--------------+ | | +--------------+ parallel with the original program | | | | text file: text. | vcs.h |==========>| | +--------------+ | | | |===========>| lesson11.sym | This is a map between the text +--------------+ +-------------+ +--------------+ symbols you used in your program and there equivalent binary value in the ROM game image. In the diagram above, I show two input files to the assembler program. There is no real limit on the number of input files to the assembler. Your program may be split across 2, 3, 10 or more files. You break a program into separate files to help you keep your ideas organized in a manner that is easier to deal with. It also can make it easier to reuse a section of code that you like in multiple programs. In the diagram, I show the assembler program as DASM, but it doesn't have to be DASM. There are literally hundreds of different assemblers in the world. Most of them are crap;P. Just so you know when you are done with these lessons, you can go off and find any assembler you like. If you program for a system that has a processor that DASM doesn't support then you will be forced to find a new assembler. DASM is a good assembler. Its not the best I have ever used, but it is good. It is also the defacto standard assembler for VCS homebrewers. Therefore, DASM is our best choice for these lessons. The next section lists the steps for finding the copy of DASM for your machine of choice and installing it. Installing DASM: ---------------- 1. Go to this website: http://www.taswegian.com/TwoHeaded/Atari2600/dasm/ 2. Click on the link for "31 OCT 2004 DASM Assembler - Version 2.20.10". Clicking on this link will download a zip file. 3. Locate the downloaded zip file and unzip it if your system hasn't done so already. The result of the extraction should be a folder named "DASM" with a number of subfolders and files within it. 3a. To avoid confusion later change the name of the DASM folder to "ASMstuff" 4. Move the extracted and renamed "ASMstuff" folder (including its subfolders) into the "APLstuff" folder you created earlier. 5. Go to the folder/directory ASMstuff in APLstuff. 6. Inside the ASMstuff folder (among other things) is a folder named "bin". Open the bin folder. 7. Inside the bin folder is a list of folders. Find the folder that matches your computer system. For Windows users you must use the DOS version of DASM. For Mac users you can pick between Classic and OS-X versions. If you have OS-X, I highly recommend you choose the OS-X version over the classic one. Linux users have a version for Linux on '86 processors. If you are running linux on something else you can try recompiling the source code. I will not try to tackle that problem, but if someone does plase post your results in this thread so that it can benefit others. There is also a version for Amiga users. 7a. For macintosh users who must operate in the classic OS. There is a .sit file. Double-click the .sit file to unpack it. It will place a file named dasm into the same folder. 8. Copy the file "dasm" or "dasm.exe" (for DOS) into the APLstuff folder. We copy it to the top of our working space so that it will be easy to find. You will be using it hundreds of times to compile and recompile your code. 9. Your directory hierarchy should now look like the image labeled "directories", that I have attached to this lesson. If it doesn't then something has gone wrong. Go back and try again from the beginning. If it still won't match, post in this thread for help. Be sure to tell us what operating system you are using. Install the emulator of your choice: ------------------------------------ 1. As Atari fans you probably already have your favorite VCS emulator installed on your system. If you do have one installed and you are comfortable using it, then you can skip this section. 2. For DOS and Windows users I recommend the Z26 emulator. For Mac users I believe your only real choice is Stella. I have found the latest version for OS-X to work great on my 500 MHz iMac, especially in fullscreen mode. 3. Search on the internet for Atari VCS emulators. Pick one you like and follow the installation instructions provided. 4. Most emulator downloads include 1 or 2 sample ROMs so you can test the installation on your system. Try one of them, and if it works go to the next section. 5. If you can not get your emulator of choice to work. Post your problem in this thread. Give the name and version of the emulator you are trying to install, and the Operating System you are using. I and your classmates will help you. Compiling and Running lesson11.asm: ------------------------------------- Your workspace should be ready now. So let's assemble the example program I have provided and confirm that your set up is truly correct. 1. Open a command line. - DOS users are always at the command line so it doesn't matter. - In Windows, go to the Start menu and find a program named either "Command Prompt" or "DOS prompt" and run it. - For Mac OS-X, go to the Utilities folder in the Applications folder and start the program named "terminal. - Classic Mac users do not have a command line. Simply double click the DASM icon to open its GUI front-end. - I plead ignorance on what Amiga users must do. If any Amiga users want to list detailed instructions for other Amiga user, please feel free to do so. I am going to assume we have no Amiga users (unless someone posts to the thread to say otherwise) and not mention it anymore. 2. Change your current/active directory to be the lesson11 directory you created under APLstuff. Both DOS and Mac OS-X use the command cd <directory-path> to change directories. Is their anyone reading this lesson that is not comfortable navigating through folders using a command line? Let me know and I will go into more detail. 3. Type in the following command at the command line EXACTLY as I have written it and hit return: For DOS/Windows: ..dasm.exe lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac OS-X: ../dasm lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac Classic: Is anyone using this setup? I don't want to go through the bother of explaining the Mac classic version if no one is going to need it. It will involve posting images of the GUI dialogs. Post in the thread if you are using Mac Classic and need help to compile this program. I will gladly help. 4. The command should produce some output ending with the word "Complete." If it doesn't, then double check to make sure you typed the command exactly as shown above. If it still won't work. Post the error message you are getting to this thread and we will figure it out. 5. Open lesson11.bin using your favorite emulator. It should show the words "Hello World", on the screen. If it works then you have successfully completed this lesson. Congratulations! Exercises: ---------- 1. In the ASMstuff folder under APLstuff there is a subfolder called doc. Your first exercise is to read DASM.doc. A lot of it won't make sense yet, but its a good idea to at least skim through it so some of the ideas will start to bubble around in your mind. 2. Open the file lesson11.asm in a text editor program. DOS users could use "edit". Windows users can use notepad.exe. 'nix users can use vi or emacs. Mac users have textedit. You can use a word processor like Word, but if you do you should set the font to Courier New and when you save be sure to save as .txt file type or Word will embed metadata into the file that will break DASM. Towards the end of the file you will find a section starting with HelloWorldGraphics. After that label you will see a list of byte sized values written in binary. If you look at the pattern of 1's and 0's you will see they form the letters of the words "HELLO" and "WORLD". Change the bits in the bytes to draw whatever you want. Save the change. Recompile the file using the same command as before, and run it in an emulator to confirm it looks they way you want. Then either post a screenshot of your change and/or your modified lesson.asm file to this thread. It wouldn't hurt to take some time to read through the code in lesson11.asm. I put a lot of comments along side the code to try and explain what it all means. Feel free to ask a question about the code, but I don't expect you to understand it yet. If you did, you don't need these lessons;) Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 13, 2004 Author Share Posted December 13, 2004 It helps if I attach the files. lesson11.asm.gz vcs.h.gz Quote Link to comment Share on other sites More sharing options...
Rob Mitchell Posted December 13, 2004 Share Posted December 13, 2004 Rob: I'm about to launch into printing and reading it .. but the ASCII illustration is warped. Rob Mitchell, Atlanta, Ga Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 13, 2004 Author Share Posted December 13, 2004 Rob: I'm about to launch into printing and reading it .. but the ASCII illustration is warped. Rob Mitchell, Atlanta, Ga Is this better? Assembly Language Programming - Lesson 11 - Setting up DASM =========================================================== Alright, we have had 10 lessons of concepts with no programming in sight and I am sure some people are getting bored. The good news is we are just about ready to start writing code. In this lesson you will set up your development environment, compile a program I have provided, and run it in the emulator of your choice. The point of this lesson is to make sure we all have the same build setup so there is minimal confusion going forward. We have enough to worry about without having to deal with everyone using a different assembler or a different directory structure. Please note, that I do not require that you use Windows, Mac, Linux, Amiga or any specific system. Use what you have. You will have to understand your system enough so that when I say create a new directory/folder you know how to do it on your system. Setting up the directory structure: ----------------------------------- 1. Choose a folder or directory on your system to hold DASM and all of your lessons. 2. In your chosen folder/directory, create a new directory named "ALPstuff" which is short for Assembly Language Programming stuff. 3. Within "ALPstuff" create a new directory/folder called "lesson11" 4. Save the two files I have attached in zipped form to this post "vcs.h" and "lesson11.asm" into the lesson11 folder you made in step 3. PLEASE DO NOT CHANGE THE NAMES OF THESE FILES, SAVE THEM AS I HAVE LISTED. Thanks. 4a. People using Winzip remember to save my files I zipped with gzip with the .gz extension or Winzip won't know how to extract them. DASM - The assembler program: ----------------------------- DASM is the assembler program we will be using for all our lessons. An assembler is a program that takes one or more text files containing the instructions of a program in human-readable form along with some extra control commands, and converts that human-readable program into a machine-readable binary file. A program in binary form is sometimes said to be in Machine Language. Assembly language is the human-readable form of a machine language for a given processor. Different processors will have a different machine language requiring a different Assembly language. Recall in lesson 7 when I defined a state machine, one of the things a state machine has is an alphabet. A machine language program (an executable binary file) is a sequence of steps for the processor written using the alphabet of the processor seen as a state machine. The diagram below tries to show how an assembler fits into our scheme. text file: binary file: +--------------+ +-------------+ outputs +--------------+ | | inputs | |===========>| lesson11.bin | This the game ROM image. | lesson11.asm |==========>| Assembler | +--------------+ | | | Program | text file: +--------------+ | | +--------------+ This is a human-readable version text file: | ( DASM ) |===========>| lesson11.lst | of the game ROM image listed in +--------------+ | | +--------------+ parallel with the original program | | | | text file: text. | vcs.h |==========>| | +--------------+ | | | |===========>| lesson11.sym | This is a map between the text +--------------+ +-------------+ +--------------+ symbols you used in your program and there equivalent binary value in the ROM game image. In the diagram above, I show two input files to the assembler program. There is no real limit on the number of input files to the assembler. Your program may be split across 2, 3, 10 or more files. You break a program into separate files to help you keep your ideas organized in a manner that is easier to deal with. It also can make it easier to reuse a section of code that you like in multiple programs. In the diagram, I show the assembler program as DASM, but it doesn't have to be DASM. There are literally hundreds of different assemblers in the world. Most of them are crap;P. Just so you know when you are done with these lessons, you can go off and find any assembler you like. If you program for a system that has a processor that DASM doesn't support then you will be forced to find a new assembler. DASM is a good assembler. Its not the best I have ever used, but it is good. It is also the defacto standard assembler for VCS homebrewers. Therefore, DASM is our best choice for these lessons. The next section lists the steps for finding the copy of DASM for your machine of choice and installing it. Installing DASM: ---------------- 1. Go to this website: http://www.taswegian.com/TwoHeaded/Atari2600/dasm/ 2. Click on the link for "31 OCT 2004 DASM Assembler - Version 2.20.10". Clicking on this link will download a zip file. 3. Locate the downloaded zip file and unzip it if your system hasn't done so already. The result of the extraction should be a folder named "DASM" with a number of subfolders and files within it. 3a. To avoid confusion later change the name of the DASM folder to "ASMstuff" 4. Move the extracted and renamed "ASMstuff" folder (including its subfolders) into the "APLstuff" folder you created earlier. 5. Go to the folder/directory ASMstuff in APLstuff. 6. Inside the ASMstuff folder (among other things) is a folder named "bin". Open the bin folder. 7. Inside the bin folder is a list of folders. Find the folder that matches your computer system. For Windows users you must use the DOS version of DASM. For Mac users you can pick between Classic and OS-X versions. If you have OS-X, I highly recommend you choose the OS-X version over the classic one. Linux users have a version for Linux on '86 processors. If you are running linux on something else you can try recompiling the source code. I will not try to tackle that problem, but if someone does plase post your results in this thread so that it can benefit others. There is also a version for Amiga users. 7a. For macintosh users who must operate in the classic OS. There is a .sit file. Double-click the .sit file to unpack it. It will place a file named dasm into the same folder. 8. Copy the file "dasm" or "dasm.exe" (for DOS) into the APLstuff folder. We copy it to the top of our working space so that it will be easy to find. You will be using it hundreds of times to compile and recompile your code. 9. Your directory hierarchy should now look like the image labeled "directories", that I have attached to this lesson. If it doesn't then something has gone wrong. Go back and try again from the beginning. If it still won't match, post in this thread for help. Be sure to tell us what operating system you are using. Install the emulator of your choice: ------------------------------------ 1. As Atari fans you probably already have your favorite VCS emulator installed on your system. If you do have one installed and you are comfortable using it, then you can skip this section. 2. For DOS and Windows users I recommend the Z26 emulator. For Mac users I believe your only real choice is Stella. I have found the latest version for OS-X to work great on my 500 MHz iMac, especially in fullscreen mode. 3. Search on the internet for Atari VCS emulators. Pick one you like and follow the installation instructions provided. 4. Most emulator downloads include 1 or 2 sample ROMs so you can test the installation on your system. Try one of them, and if it works go to the next section. 5. If you can not get your emulator of choice to work. Post your problem in this thread. Give the name and version of the emulator you are trying to install, and the Operating System you are using. I and your classmates will help you. Compiling and Running lesson11.asm: ------------------------------------- Your workspace should be ready now. So let's assemble the example program I have provided and confirm that your set up is truly correct. 1. Open a command line. - DOS users are always at the command line so it doesn't matter. - In Windows, go to the Start menu and find a program named either "Command Prompt" or "DOS prompt" and run it. - For Mac OS-X, go to the Utilities folder in the Applications folder and start the program named "terminal. - Classic Mac users do not have a command line. Simply double click the DASM icon to open its GUI front-end. - I plead ignorance on what Amiga users must do. If any Amiga users want to list detailed instructions for other Amiga user, please feel free to do so. I am going to assume we have no Amiga users (unless someone posts to the thread to say otherwise) and not mention it anymore. 2. Change your current/active directory to be the lesson11 directory you created under APLstuff. Both DOS and Mac OS-X use the command cd <directory-path> to change directories. Is their anyone reading this lesson that is not comfortable navigating through folders using a command line? Let me know and I will go into more detail. 3. Type in the following command at the command line EXACTLY as I have written it and hit return: For DOS/Windows: ..dasm.exe lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac OS-X: ../dasm lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac Classic: Is anyone using this setup? I don't want to go through the bother of explaining the Mac classic version if no one is going to need it. It will involve posting images of the GUI dialogs. Post in the thread if you are using Mac Classic and need help to compile this program. I will gladly help. 4. The command should produce some output ending with the word "Complete." If it doesn't, then double check to make sure you typed the command exactly as shown above. If it still won't work. Post the error message you are getting to this thread and we will figure it out. 5. Open lesson11.bin using your favorite emulator. It should show the words "Hello World", on the screen. If it works then you have successfully completed this lesson. Congratulations! Exercises: ---------- 1. In the ASMstuff folder under APLstuff there is a subfolder called doc. Your first exercise is to read DASM.doc. A lot of it won't make sense yet, but its a good idea to at least skim through it so some of the ideas will start to bubble around in your mind. 2. Open the file lesson11.asm in a text editor program. DOS users could use "edit". Windows users can use notepad.exe. 'nix users can use vi or emacs. Mac users have textedit. You can use a word processor like Word, but if you do you should set the font to Courier New and when you save be sure to save as .txt file type or Word will embed metadata into the file that will break DASM. Towards the end of the file you will find a section starting with HelloWorldGraphics. After that label you will see a list of byte sized values written in binary. If you look at the pattern of 1's and 0's you will see they form the letters of the words "HELLO" and "WORLD". Change the bits in the bytes to draw whatever you want. Save the change. Recompile the file using the same command as before, and run it in an emulator to confirm it looks they way you want. Then either post a screenshot of your change and/or your modified lesson.asm file to this thread. It wouldn't hurt to take some time to read through the code in lesson11.asm. I put a lot of comments along side the code to try and explain what it all means. Feel free to ask a question about the code, but I don't expect you to understand it yet. If you did, you don't need these lessons;) Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 13, 2004 Author Share Posted December 13, 2004 Damn, the missing edit button. Here is the truly corrected formatting. Assembly Language Programming - Lesson 11 - Setting up DASM =========================================================== Alright, we have had 10 lessons of concepts with no programming in sight and I am sure some people are getting bored. The good news is we are just about ready to start writing code. In this lesson you will set up your development environment, compile a program I have provided, and run it in the emulator of your choice. The point of this lesson is to make sure we all have the same build setup so there is minimal confusion going forward. We have enough to worry about without having to deal with everyone using a different assembler or a different directory structure. Please note, that I do not require that you use Windows, Mac, Linux, Amiga or any specific system. Use what you have. You will have to understand your system enough so that when I say create a new directory/folder you know how to do it on your system. Setting up the directory structure: ----------------------------------- 1. Choose a folder or directory on your system to hold DASM and all of your lessons. 2. In your chosen folder/directory, create a new directory named "ALPstuff" which is short for Assembly Language Programming stuff. 3. Within "ALPstuff" create a new directory/folder called "lesson11" 4. Save the two files I have attached in zipped form to this post "vcs.h" and "lesson11.asm" into the lesson11 folder you made in step 3. PLEASE DO NOT CHANGE THE NAMES OF THESE FILES, SAVE THEM AS I HAVE LISTED. Thanks. 4a. People using Winzip remember to save my files I zipped with gzip with the .gz extension or Winzip won't know how to extract them. DASM - The assembler program: ----------------------------- DASM is the assembler program we will be using for all our lessons. An assembler is a program that takes one or more text files containing the instructions of a program in human-readable form along with some extra control commands, and converts that human-readable program into a machine-readable binary file. A program in binary form is sometimes said to be in Machine Language. Assembly language is the human-readable form of a machine language for a given processor. Different processors will have a different machine language requiring a different Assembly language. Recall in lesson 7 when I defined a state machine, one of the things a state machine has is an alphabet. A machine language program (an executable binary file) is a sequence of steps for the processor written using the alphabet of the processor seen as a state machine. The diagram below tries to show how an assembler fits into our scheme. text file: binary file: +--------------+ +-------------+ outputs +--------------+ | | inputs | |===========>| lesson11.bin | This the game ROM image. | lesson11.asm |==========>| Assembler | +--------------+ | | | Program | text file: +--------------+ | | +--------------+ This is a human-readable | ( DASM ) |===========>| lesson11.lst | version of the game ROM text file: | | +--------------+ image listed in parallel +--------------+ | | with the original program | | | | text file: text. | vcs.h |==========>| | +--------------+ | | | |===========>| lesson11.sym | This is a map between the +--------------+ +-------------+ +--------------+ text symbols you used in your program and their equivalent binary value in the ROM game image. In the diagram above, I show two input files to the assembler program. There is no real limit on the number of input files to the assembler. Your program may be split across 2, 3, 10 or more files. You break a program into separate files to help you keep your ideas organized in a manner that is easier to deal with. It also can make it easier to reuse a section of code that you like in multiple programs. In the diagram, I show the assembler program as DASM, but it doesn't have to be DASM. There are literally hundreds of different assemblers in the world. Most of them are crap;P. Just so you know when you are done with these lessons, you can go off and find any assembler you like. If you program for a system that has a processor that DASM doesn't support then you will be forced to find a new assembler. DASM is a good assembler. Its not the best I have ever used, but it is good. It is also the defacto standard assembler for VCS homebrewers. Therefore, DASM is our best choice for these lessons. The next section lists the steps for finding the copy of DASM for your machine of choice and installing it. Installing DASM: ---------------- 1. Go to this website: http://www.taswegian.com/TwoHeaded/Atari2600/dasm/ 2. Click on the link for "31 OCT 2004 DASM Assembler - Version 2.20.10". Clicking on this link will download a zip file. 3. Locate the downloaded zip file and unzip it if your system hasn't done so already. The result of the extraction should be a folder named "DASM" with a number of subfolders and files within it. 3a. To avoid confusion later change the name of the DASM folder to "ASMstuff" 4. Move the extracted and renamed "ASMstuff" folder (including its subfolders) into the "APLstuff" folder you created earlier. 5. Go to the folder/directory ASMstuff in APLstuff. 6. Inside the ASMstuff folder (among other things) is a folder named "bin". Open the bin folder. 7. Inside the bin folder is a list of folders. Find the folder that matches your computer system. For Windows users you must use the DOS version of DASM. For Mac users you can pick between Classic and OS-X versions. If you have OS-X, I highly recommend you choose the OS-X version over the classic one. Linux users have a version for Linux on '86 processors. If you are running linux on something else you can try recompiling the source code. I will not try to tackle that problem, but if someone does plase post your results in this thread so that it can benefit others. There is also a version for Amiga users. 7a. For macintosh users who must operate in the classic OS. There is a .sit file. Double-click the .sit file to unpack it. It will place a file named dasm into the same folder. 8. Copy the file "dasm" or "dasm.exe" (for DOS) into the APLstuff folder. We copy it to the top of our working space so that it will be easy to find. You will be using it hundreds of times to compile and recompile your code. 9. Your directory hierarchy should now look like the image labeled "directories", that I have attached to this lesson. If it doesn't then something has gone wrong. Go back and try again from the beginning. If it still won't match, post in this thread for help. Be sure to tell us what operating system you are using. Install the emulator of your choice: ------------------------------------ 1. As Atari fans you probably already have your favorite VCS emulator installed on your system. If you do have one installed and you are comfortable using it, then you can skip this section. 2. For DOS and Windows users I recommend the Z26 emulator. For Mac users I believe your only real choice is Stella. I have found the latest version for OS-X to work great on my 500 MHz iMac, especially in fullscreen mode. 3. Search on the internet for Atari VCS emulators. Pick one you like and follow the installation instructions provided. 4. Most emulator downloads include 1 or 2 sample ROMs so you can test the installation on your system. Try one of them, and if it works go to the next section. 5. If you can not get your emulator of choice to work. Post your problem in this thread. Give the name and version of the emulator you are trying to install, and the Operating System you are using. I and your classmates will help you. Compiling and Running lesson11.asm: ------------------------------------- Your workspace should be ready now. So let's assemble the example program I have provided and confirm that your set up is truly correct. 1. Open a command line. - DOS users are always at the command line so it doesn't matter. - In Windows, go to the Start menu and find a program named either "Command Prompt" or "DOS prompt" and run it. - For Mac OS-X, go to the Utilities folder in the Applications folder and start the program named "terminal. - Classic Mac users do not have a command line. Simply double click the DASM icon to open its GUI front-end. - I plead ignorance on what Amiga users must do. If any Amiga users want to list detailed instructions for other Amiga user, please feel free to do so. I am going to assume we have no Amiga users (unless someone posts to the thread to say otherwise) and not mention it anymore. 2. Change your current/active directory to be the lesson11 directory you created under APLstuff. Both DOS and Mac OS-X use the command cd <directory-path> to change directories. Is their anyone reading this lesson that is not comfortable navigating through folders using a command line? Let me know and I will go into more detail. 3. Type in the following command at the command line EXACTLY as I have written it and hit return: For DOS/Windows: ..dasm.exe lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac OS-X: ../dasm lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym For Mac Classic: Is anyone using this setup? I don't want to go through the bother of explaining the Mac classic version if no one is going to need it. It will involve posting images of the GUI dialogs. Post in the thread if you are using Mac Classic and need help to compile this program. I will gladly help. 4. The command should produce some output ending with the word "Complete." If it doesn't, then double check to make sure you typed the command exactly as shown above. If it still won't work. Post the error message you are getting to this thread and we will figure it out. 5. Open lesson11.bin using your favorite emulator. It should show the words "Hello World", on the screen. If it works then you have successfully completed this lesson. Congratulations! Exercises: ---------- 1. In the ASMstuff folder under APLstuff there is a subfolder called doc. Your first exercise is to read DASM.doc. A lot of it won't make sense yet, but its a good idea to at least skim through it so some of the ideas will start to bubble around in your mind. 2. Open the file lesson11.asm in a text editor program. DOS users could use "edit". Windows users can use notepad.exe. 'nix users can use vi or emacs. Mac users have textedit. You can use a word processor like Word, but if you do you should set the font to Courier New and when you save be sure to save as .txt file type or Word will embed metadata into the file that will break DASM. Towards the end of the file you will find a section starting with HelloWorldGraphics. After that label you will see a list of byte sized values written in binary. If you look at the pattern of 1's and 0's you will see they form the letters of the words "HELLO" and "WORLD". Change the bits in the bytes to draw whatever you want. Save the change. Recompile the file using the same command as before, and run it in an emulator to confirm it looks they way you want. Then either post a screenshot of your change and/or your modified lesson.asm file to this thread. It wouldn't hurt to take some time to read through the code in lesson11.asm. I put a lot of comments along side the code to try and explain what it all means. Feel free to ask a question about the code, but I don't expect you to understand it yet. If you did, you don't need these lessons;) Quote Link to comment Share on other sites More sharing options...
Rob Mitchell Posted December 15, 2004 Share Posted December 15, 2004 I keep getting a fatal error when compiling .. I have everything in the same directory. >>For DOS/Windows: dasm.exe lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym << Rob Mitchell, Atlanta, GA Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 15, 2004 Author Share Posted December 15, 2004 I keep getting a fatal error when compiling .. I have everything in the same directory. >>For DOS/Windows: dasm.exe lesson11.asm -f3 -olesson11.bin -llesson11.lst -slesson11.sym << Rob Mitchell, Atlanta, GA Hello, The command appears to be correct. Can you post the exact error message as it appears on your screen? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted December 15, 2004 Share Posted December 15, 2004 The backslash before dasm.exe might be the problem. Quote Link to comment Share on other sites More sharing options...
Emehr Posted December 15, 2004 Share Posted December 15, 2004 For Mac Classic: Is anyone using this setup? *raises hand* I think I may be the only one here using DASM on a pre-OS X Mac. Anyway, to clarify its usage (just for completion's sake), you need Apple's MPW (Macintosh Programmer's Workshop) to run DASM for Classic Mac OS. MPW is a command-line program and is just the thing for using DASM, DiStella, MakeWav and whatever other tools are in it's "Tools" folder. I put together a web site a while back that is a work in progress but should be enough to get anybody started with Stella development on a pre-OS X Mac. On my site I've included the link to Apple's FTP site for downloading MPW (~1.6 MB IIRC). http://home.earthlink.net/~jjrein/stella/ - Classic Mac users do not have a command line. Simply double click the DASM icon to open its GUI front-end. I don't recommend double-clicking the DASM icon to run DASM. That'll just open MPW (if you have it) and set the working directory to the "Tools" folder (which is where DASM should be placed, incidentally). You'd then have to change the working directory to your Stella folder (which is an avoidable step). Creating a blank MPW file (I call mine "Start MPW") and placing it in your Stella folder is what I recommend. Simply double-click that file and MPW will fire up and set the working directory to your Stella folder. You can type commands in that window or return to MPW's "Worksheet" window and do it there. Hope that helps! - Jason Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 16, 2004 Author Share Posted December 16, 2004 For Mac Classic: Is anyone using this setup? *raises hand* I think I may be the only one here using DASM on a pre-OS X Mac. Thank-you very much for taking the time to layout things for Mac Classic users. I appreciate your help. Regards, Quote Link to comment Share on other sites More sharing options...
Emehr Posted December 16, 2004 Share Posted December 16, 2004 You're very welcome . - Jason Quote Link to comment Share on other sites More sharing options...
Rob Mitchell Posted December 16, 2004 Share Posted December 16, 2004 The command appears to be correct. Can you post the exact error message as it appears on your screen? "Fatal assembly error: Check command-line format" Rob Mitchell, Atlanta, GA Quote Link to comment Share on other sites More sharing options...
Rob Mitchell Posted December 16, 2004 Share Posted December 16, 2004 I just figured out my mistake .. I typed -0 when it should be -o. [it should be the letter o and not the number 0.] Ugh! Well now I am in business! Rob Mitchell, Atlanta, GA Quote Link to comment Share on other sites More sharing options...
Rob Mitchell Posted December 16, 2004 Share Posted December 16, 2004 PF1LeftGraphics ; .byte %00000000 .byte %11111111 .byte %01111110 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00000000 .byte %11100111 .byte %01100110 .byte %01100110 .byte %01111110 .byte %01111110 .byte %01100110 .byte %01100110 .byte %11100111 .byte %00000000 .byte %00011000 .byte %01100110 .byte %11000011 .byte %11111111 .byte %11000011 .byte %11000011 .byte %11000011 .byte %11000011 .byte %00000000 .byte %11000011 .byte %11100011 .byte %11011011 .byte %11001111 .byte %11000111 .byte %11000011 .byte %11000011 .byte %11000011 .byte %00000000 .byte %11000011 .byte %11000110 .byte %11001100 .byte %11011000 .byte %11111000 .byte %11001100 .byte %11000110 .byte %11000011 .byte %00000000 PF1RightGraphics ; .byte %00000000 .byte %11000011 .byte %11000011 .byte %11000011 .byte %00111100 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00000000 .byte %00111100 .byte %01100110 .byte %01100110 .byte %11000011 .byte %11000011 .byte %01100110 .byte %01100110 .byte %00111100 .byte %00000000 .byte %11000011 .byte %11000011 .byte %11000011 .byte %11000011 .byte %11000011 .byte %11000011 .byte %01100110 .byte %00011000 .byte %00000000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00011000 .byte %00000000 .byte %00011000 .byte %00011000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 .byte %00000000 This is my message to you! Rob Mitchell, Atlanta, GA Quote Link to comment Share on other sites More sharing options...
Robert M Posted December 16, 2004 Author Share Posted December 16, 2004 I just figured out my mistake .. I typed -0 when it should be -o. [it should be the letter o and not the number 0.] Ugh! Well now I am in business! Rob Mitchell, Atlanta, GA Argh! The dreaded 0-o typo! I should has made it clear that it was letter-o and not a zero. I am glad to see it is working for you now. That is a nice mod on the graphics. Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.