?? intro-6.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD> <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20"> <TITLE>cc65 compiler intro: Running The Executable</TITLE> <LINK HREF="intro-5.html" REL=previous> <LINK HREF="intro.html#toc6" REL=contents></HEAD><BODY>Next<A HREF="intro-5.html">Previous</A><A HREF="intro.html#toc6">Contents</A><HR><H2><A NAME="s6">6.</A> <A HREF="intro.html#toc6">Running The Executable</A></H2><P><B>Note: this section is incomplete!</B></P><P>Depending on the target, the compiler chooses several methods of making aprogram available for execution. Here we list sample emulators andinstructions for running the program. Unless noted, similar instructionswould also apply to a real machine. One word of advice: we suggest you clearthe screen at the start, and wait for a keypress at the end of your program,as each target varies in it's start and exit conditions.</P><H2><A NAME="ss6.1">6.1</A> <A HREF="intro.html#toc6.1">Apple</A></H2><P><B>AppleWin 1.10.4</B> (available at<A HREF="http://www.jantzer-schmidt.de/applewin/">http://www.jantzer-schmidt.de/applewin/</A>): Emulates Apple II+/IIecomputer, with sound, video, joysticks, serial port, and disk images. Roms anddos disk included. Includes monitor. Only for Windows. The package comes withroms and dos3.3 disk (called master.dsk), however you will need a2tools(available at <A HREF="http://hotel04.ausys.se/pausch/apple2/#a2tools">http://hotel04.ausys.se/pausch/apple2/#a2tools</A>).</P><P>Compile the tutorial with</P><P><BLOCKQUOTE><CODE><PRE>cl65 -O -t apple2 hello.c text.s</PRE></CODE></BLOCKQUOTE></P><P>Then insert the file into an Apple disk image for use with an emulator. Copythe master.dsk which comes with Applewin and rename it to cc65.dsk, then usea2tools:</P><P><BLOCKQUOTE><CODE><PRE>a2tools in -r b cc65.dsk TEST hello</PRE></CODE></BLOCKQUOTE></P><P>Note that a convention in the Apple world is that hello is the file which isautomatically run upon booting a DOS disk, sort of like the Autoexec.bat ofthe PC world. We've avoided this in the example however. Also, the TESTparameter must be in caps, and is the name of the program as it will appear onthe Apple disk.</P><P>Start the emulator, click on the Disk 1 icon, and point to cc65.dsk, thenclick the big Apple logo to boot the system. Then type this on the Apple:</P><P><BLOCKQUOTE><CODE><PRE>BRUN TEST</PRE></CODE></BLOCKQUOTE></P><P>You will see the "Hello, World!" appear on the same line. Thanks to OliverSchmidt, <A HREF="mailto:oliver@jantzer-schmidt.de">oliver@jantzer-schmidt.de</A> for his help in completing this section.</P><H2><A NAME="ss6.2">6.2</A> <A HREF="intro.html#toc6.2">Atari</A></H2><P><B>Atari800Win Plus 3.0</B> (available at<A HREF="http://www.a800win.atari-area.prv.pl">http://www.a800win.atari-area.prv.pl</A>): Emulates Atari400/800/65XE/130XE/800XL/1200XL/5200, with stereo sound, disk images, scanlineexact NTSC/PAL video, joysticks, mouse, cartridges and ram expansions.Includes monitor. Unfortunately only for Windows. You will need the emulator,atarixl.rom or atariosb.rom/ataribas.rom and dos25.xfd files (not supplied).</P><P>Compile the tutorial with</P><P><BLOCKQUOTE><CODE><PRE>cl65 -O -t atari hello.c text.s</PRE></CODE></BLOCKQUOTE></P><P>Start the emulator, choose File>Autoboot image or File>Load executable, andpoint to the hello executable. It is customary to rename executables of thistype to hello.xex. The file has a 7 byte header meant to be loaded directlyfrom Atari DOS 2/2.5 or compatibles.</P><P>On a real Atari, you would need a disk drive and Atari Dos 2.5 or compatible.Turn on the computer, type</P><P><BLOCKQUOTE><CODE><PRE>DOS</PRE></CODE></BLOCKQUOTE></P><P>at the basic prompt, then choose N. CREATE MEM.SAV then choose L. BINARY LOADand enter HELLO.</P><P>The emulation also supports this method. Look at Atari>Settings and checkEnable H: Patch for Hard Disk Devices, then Atari>Hard disks and set the pathof H1: to your executables directory, then use H0:HELLO.XEX in the aboveproceedure (after pressing L) to access your hardrive directly.</P><P><B>Note:</B> There is no delay after the program exits, as you are returnedto the DOS menu. Your C program should wait for a keypress if you want to seeany output.</P><H2><A NAME="ss6.3">6.3</A> <A HREF="intro.html#toc6.3">Commodore</A></H2><P><B>Vice 1.9</B> (available at<A HREF="ftp://ftp.funet.fi/pub/cbm/crossplatform/emulators/VICE/">ftp://ftp.funet.fi/pub/cbm/crossplatform/emulators/VICE/</A>):Emulates Commodore 64/128/Vic 20/PET/CBM II computers. Missing is the Plus/4and Commodore 16. Supports printer, serial port, stereo sound, disk drives andimages, ram expansions, cartridges, cycle exact NTSC/PAL video, mice,joysticks. Includes monitor. Runs on Win9x/NT/2000/XP/ME/OS2/MSDOS, Beos x86,Acorn RISC OS, and many Unixes.</P><P>Start the desired version of the emulator, choose File>Autoboot disk/tapeimage, and choose your executable. The file has a 14 byte header whichcorresponds to a PRG format BASIC program, consisting of a single line;</P><P><BLOCKQUOTE><CODE><HR><PRE>1000 sys2061</PRE><HR></CODE></BLOCKQUOTE></P><P>On a real Commodore with attached disk drive, you would type:</P><P><BLOCKQUOTE><CODE><PRE>LOAD "HELLO",8</PRE></CODE></BLOCKQUOTE></P><P>for Vic 20/C64, or</P><P><BLOCKQUOTE><CODE><PRE>DLOAD "0:HELLO"</PRE></CODE></BLOCKQUOTE></P><P>on PET/CBM II/C128, then type</P><P><BLOCKQUOTE><CODE><PRE>RUN</PRE></CODE></BLOCKQUOTE></P><P>The output will appear on a separate line, and you will be returned to a BASICprompt.</P><P>We need your help! Recommended emulators and instructions for other targetsare missing. We suggest an emulator with good compatibility. Also, being ableto run all computers in the target series is good for target compatibilitytesting. A machine language monitor is almost essential for debugging, but anative debugger could be used as well.</P><P>Finally, emulators which run on Unix/Windows would help reach a wider audience.</P><HR>Next<A HREF="intro-5.html">Previous</A><A HREF="intro.html#toc6">Contents</A></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -