1 / 24

Introduction to 68000 Programming Environment Using MetroWerks CodeWarrior and Palm Emulator

Introduction to 68000 Programming Environment Using MetroWerks CodeWarrior and Palm Emulator. Contents. Differences between standard 68000 assembly language and Palm-based assembly language Overview of MetroWerks CodeWarrior and Palm Emulator Download and Instrall

Pat_Xavi
Download Presentation

Introduction to 68000 Programming Environment Using MetroWerks CodeWarrior and Palm Emulator

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to68000 Programming EnvironmentUsing MetroWerks CodeWarrior and Palm Emulator

  2. Contents • Differences between standard 68000 assembly language and Palm-based assembly language • Overview of MetroWerks CodeWarrior and Palm Emulator • Download and Instrall • Using MetroWerks CodeWarrior to • - edit a program • - compile a program • - make (link) and program • - load a program • 5. Palm Emulator

  3. Differences between standard 68000 assembly language and Palm-based assembly language

  4. Overview 68000 Assembler editor C & 68000 assembly program Embedded in C compiler other 68000 code 68000 machine code executable binary of a specific machine . . . Bring Up to Date Make linker MetroWerks CodeWarrior Programming Environment executable code Palm DeBugger PDA or Emulator

  5. Download and Install Palm Emulator and MetroWerks • Download and install Palm Emulator and MetroWerks Demo version on your PC. • Go to the following URL for the steps needed to install CodeWarrior. The Palm Emulator comes with the demo version 8.0.http://www.palmos.com/dev/training/online/course_p_1-r.html • The links are provided for the CodeWarrior download. When selecting the link: • http://www.metrowerks.com/contact/secure/palmdemo/ • you are taken to the download area of the metrowerks website. If you scroll down to the bottom of the screen you will see fields for your name and email address. You will need to fill in this information and send it in order to receive an email with a password in order to install the demo. • Next you need to register with palm in order to access the ROM images. It takes one or two business days to process the request in order to download. The link to join is,http://www.palmos.com/dev/programs/pdp/join.html

  6. Download and install (contd.) • After installing the CodeWarrior demo, all the items that you will need are in the CodeWarrior folder in • C:\Program Files\Metrowerks\CodeWarrior. • The Palm Emulator is in • ...\CodeWarrior\Palm Tools\Palm OS 4.0 SDK\Other Tools. • Download the sample package SampleProject.zip • Unzip and start the project.

  7. Using GWC167 Lab for CSE225 You could do the sample project in CSE225 lab, or follow the same steps to do it on your PC. In GWC167, you must save your work into a floppy disk, or into your M drive, or email it to your email account. Your work will be automatically removed after you log off your account. Please note, CodeWarrior Demo and Palm Emulator have been installed in the machines in GWC167.

  8. Using CodeWarrior • Go to \Homework 5\CSE 225 Lab 0 • Open the project file "Lab 0.mcp" • Close the "project message" window if it occurs • Click the "File" in the "Lab 0.mcp" window. • Open the "Palm Lab 0 .c" file in "Assembly" folder in the Lab 0.mcp window.

  9. Using CodeWarrior – contd. • Goto the MetroWerks CodeWarrior menu: ProjectCompile, and then ProjectBring Up To Date, and then ProjectMake to build the project • You are now ready to load the program on to Palm OS Emulator and execute it.

  10. Put the Executable into the Device Folder • After the "Make" (link) operation, a lab0p1.prc file (the final executable file) is created. If the "target" of your project is the set to the following directory"C:\Program Files\Metrowerks\CodeWarrior\Palm Tools\Palm OS Other SDK Tools\Palm Debugger\Device"the .prc file (executable) gets created in this directory, overwriting previous existing files. • This target path should have been set. If not, you can set the the project target settings accessible from the project main window. The path can be an absolute one or relative to your project folder. • If you still do not know how to set this target path then manually copy the .prc file from its current location to the above location. Most likely, the current location is the "CSE 225 Lab folder". You can also use "search" to find it). Then do the following: • Copy the lab0p1.prc file from your project folder • Go to folder "CSE 225" folder (on the desktop) • Go to Palm OS folder • Go to Palm Debugger folder • Go to Device folder • Paste the lab0p1.prc file into the Device folder.

  11. Using Palm OS Emulator • Go to folder "CSE 225" on the desktop • Go to Palm OS folder • Open the Palm OS Emulator application (Emulator.exe) • You will see the following screen

  12. Using Palm OS Emulator – cont. • Click on the New button. This will start a new Emulator session for you. • The following screen will appear.

  13. Using Palm OS Emulator – cont. • Click on the drop-down list labeled ‘ROM file’ • Select the option ‘Other’ • This will allow you to choose a particular ROM file. • Go to the folder ‘Popular ROM Downloads’ • Select the file ‘Palm OS 3.5-en-ezdbg’

  14. Using Palm OS Emulator – cont. • Click on Open button on the File Choose Dialog Box. • Now, you will see the following screen

  15. Using Palm OS Emulator – cont. • Click on the drop-down list labeled ‘Device’ • Select the option ‘Palm Vx’ • Click on the drop-down list labeled ‘RAM Size’ • Select the option ’16, 384 K’. • Click on the OK button.

  16. Using Palm OS PDA/Emulator – cont. • The following screen will appear Application icon

  17. Using Palm Debugger • Now, go to folder CSE 225 on the desktop • Go to Palm OS folder • Go to Palm Debugger folder • Open the Palm Debugger (PalmDebugger.exe) This will allow you to download your application to the Palm OS Emulator

  18. Using Palm Debugger – contd. • After doing the steps outlined in the previous slide, you should be able to see the Palm Debugger Application. • Now, go to Connection menu: • Select the "Emulator" option (If you see a "", it is already selected). • Select the "USB" option if you have connected a Palm PDA (hand-held computer) through a USB cable.

  19. Download the executable to the Palm Emulator • Go to Console window • Type the following command: import 0 Lab0p1.prcNote thatPalm Emulator must be running before you execute the command. • If no errors occur, the debugger will indicate that your application has been downloaded to the Palm OS Emulator. Skip the next slide.

  20. Download the executable to the Palm Emulator (contd.) • If an error occurs, close the Palm Emulator • Re-start the Palm Emulator • Redo the steps in the previous slide • If an error still occurs, close the Palm OS Emulator and Palm Debugger. • Redo the whole procedure

  21. Download the executable to the Palm PDA • Make sure that your Palm Hotsync manager is running (you should see the icon in the system trap. • Start the “Palm Desktop” application. • Click on the tool icon “install”. A dialog box will appear. • Click “Add” and browse to the location of the executable “Lab0p1.prc”. It should be in your Device folder at:\Metrowerks\CodeWarrior\Palm Tools\Palm OS 4.0 SDK Other Tools\PalmDebugger\Device • After you have added the executable, push the Hotsync iconon the Cradle of the PDA. • The executable should be downloaded into the folder “unfiled”. • Start the application. • Note, you must use the Stylus to enter the command. You can find how to write different characters under “Graffiti” – “Try It”.

  22. Set Breakpoints to Debug Your Programs • Add an debugging directive _DbgBreakin your program to insert a breakpoint. • Then use g command in the Debugger Window of Palm Debugger to allow the program to execute up to its next breakpoint. • If there is no other breakpoint after this one, then the program will run to its completion. • When the program stops at the breakpoint, you can see the CPU registers in the window named ‘CPU Registers’ [lower right portion]. • When the program stops at the breakpoint, you can use the commands under menu "Source" to execute single steps.

  23. Printing to the Emulator Screen • You can use three library functions to print memory or register contents - JSR WriteString: It will write a string starting from [M([A0])] - JSR WriteChar: It will write a character stored in D0 - JSR WriteNum: It will write a number stored in D0

  24. Back to Palm OS Emulator • Go back to Palm OS Emulator. • Click on ‘Applications’ icon on the Palm screen. • You will see an icon that has your file name. • Click on it to execute your application Lab 0 p1.

More Related