DreaMon Manual Doc Bacardi -------------------------------------------------------------------------------- Table of Contents 1. Preface 2. Installation How to get DreaMon Start 3. Command Reference Command Index Assemble Compare Disassemble Fill Go Hunt Ascii and Screencode dump Load Load FKeys Load Labels Ascii and Screencode memory dump Opcode hunt Preferences Dump and memdump output I/O Device Select Mapping Mode Registers Save Save FKeys Save Labels Transfer Verify Swap Exit Manage Freezepoints Dos commands 4. General Usage Default numeric systems Range Area Scrollmode Ctrl-Shift keys Label Enlarging numbers F-Keys Freezepoints Terms A. Past, present and future History ToDo B. Index -------------------------------------------------------------------------------- Chapter 1. Preface DreaMon is an assembly language monitor for the SCPU. It requires a Super Ram Card. Some features:   * Freezepoints interrupt a running programm   * der Scrollmode enables fast and confortable debugging   * all over the programm numbers can be described by any combination of binary, octal, decimal and hexadecimal as well as Label and terms. Read more about it in the chapter Terms.   * the FKeys can contain free defineable macros.   * on a C128 the 80 colums screen can be used with up to 39 lines (my monitor does not like more, DreaMon can handle up to 50 lines) This text describes version 1.2.4 . You can find my plans for the future in the ToDo chapter. The chapter Start describes the installation of DreaMon into the memory. A summary of all commands can be found at the Command Reference. All chapters are listed in the Index. If you have ideas, criticism or bug reports please contact me by mail: < DocBacardi@freenet.de> These are the tools I used to develop this programm:   * the crossassembler XA by Andre Fachat and Jolse Maginnis,   * the development environment KDevelop,   * the transfertool PrLink,   * the crosspacker PuCrunch by Pasi Ojala und   * Ninja's online help AAY 64. Special thanks to the Go64! who lended me a SCPU until I could afford my own one. Furthermore the following people supported me with ideas, motivation and beta-testing: Ninja/DRM Count Zero/SCS+TRC Jolse Maginnis Stephan Andres Krill und Brix/+H Mac Gyver/DMAgic Auch an Euch ein großes Danke! Doc Bacardi/The Dreams       ______              ______              ___________                     __\     \    ______ __\     \    ______ __\          \    ______         /\  \_____\ __\     \   \_____\ __\     \   \__________\ __\     \       /  \__\__  ¬\_  \_____\ __\__  ¬\_  \_____\ __\_______  ¬\_  \_____\     /   /    /    /\__\__  ¬\_   /____/\__\__  ¬\_   /    /    /\__\__  ¬\_  /   /    /    / /   _/    /  ___/_  /   _/    /  /    /    / /    /____/  \  /    /    / /    \____/  /    / /    \    /  /    /    / /\___    \     ·/_________/ /    /    /_______/ /    /    /__/____/    /\/    /    /                \/____/    /        \/____/    /      \/_____\ \________/                     \/_____\            \/_____\                                           cRu/1oo                                                                     ·                       http://www.the-dreams.de            -------------------------------------------------------------------------------- Chapter 2. Installation How to get DreaMon The latest DreaMon version and this docbook can be downloaded from 'Little Dreamland' : http://people.freenet.de/LittleDreamLand. -------------------------------------------------------------------------------- Start After you run the DreaMon a little menu appears. Here you can select the destination in the SRam. DreaMon suggests the upper end of the ram. Use the cursor keys to move the bar around and press return to edit a field. To edit a number, use the cursor keys, home, clear, stop and ctrl+cursors (to move to start/end of the field). Return confirms the input. 'Code' is the position of the DreaMon itself 'Text' is a buffer for labels and fkeys The code must not cross a bank border. To keep an eye on this the current end adress is displayed behind the input field. Wrong inputs are catched, of course. The size of the text buffer is variable. It can reach from 2 pages up to all available SRam. An efficient size depends on how many labels and macros you want to use. The displayed suggestion should be more than enough for the beginning. After your done, the config tool disappears and leaves a little sys which you should keep in mind. This is the way to start DreaMon from basic. -------------------------------------------------------------------------------- Chapter 3. Command Reference Command Index +---------------------------------------------+--------------------------------+ |Syntax |Kommando | +---------------------------------------------+--------------------------------+ |a Adress [Opcode] |assemble | +---------------------------------------------+--------------------------------+ |c Area Ziel |compare | +---------------------------------------------+--------------------------------+ |d Range |disassembe | +---------------------------------------------+--------------------------------+ |f Area Pattern |fill | +---------------------------------------------+--------------------------------+ |g Adress |go | +---------------------------------------------+--------------------------------+ |h Area Wildpattern |hunt | +---------------------------------------------+--------------------------------+ |i Range |ascii dump | +---------------------------------------------+--------------------------------+ |j Range |screencode dump | +---------------------------------------------+--------------------------------+ |l "Filename" [,Device [,Loadadress]] |load | +---------------------------------------------+--------------------------------+ |lf "Filename" [,Device] |load fkeys | +---------------------------------------------+--------------------------------+ |ll "Filename" [,Device] |load labels | +---------------------------------------------+--------------------------------+ |m Range |memory ascii dump | +---------------------------------------------+--------------------------------+ |n Range |memory screencode dump | +---------------------------------------------+--------------------------------+ |o Area Wildpattern |opcode hunt | +---------------------------------------------+--------------------------------+ |p settings... |preferences | +---------------------------------------------+--------------------------------+ |r |show registers | +---------------------------------------------+--------------------------------+ |s "Filename" ,Device ,Range [,Loadadress] |save | +---------------------------------------------+--------------------------------+ |sf "Filename" [,Device] |save fKeys | +---------------------------------------------+--------------------------------+ |sl "Filename" [,Device] |save labels | +---------------------------------------------+--------------------------------+ |t Area Ziel |copy memory | +---------------------------------------------+--------------------------------+ |v "Filename" [,Device [,Loadadress]] |verify | +---------------------------------------------+--------------------------------+ |w Area Ziel |swap memory | +---------------------------------------------+--------------------------------+ |x [t] |exit/trace | +---------------------------------------------+--------------------------------+ |z [all | Adress [JumpType Action [Parameter] |manage freezepoints | |]] | | +---------------------------------------------+--------------------------------+ |£LabelName [= [Term]] |define/use/delete label | +---------------------------------------------+--------------------------------+ |? Term |show result of a term | +---------------------------------------------+--------------------------------+ |@ [#Device] [Command] |send DOS command / show status | +---------------------------------------------+--------------------------------+ |> Disass Output |edit disassembler output | +---------------------------------------------+--------------------------------+ |. Ascii Dump Output |edit ascii dump output | +---------------------------------------------+--------------------------------+ |, Screencode Dump Output |edit screencode dump output | +---------------------------------------------+--------------------------------+ |: Memory Ascii Dump Output |edit memory ascii dump output | +---------------------------------------------+--------------------------------+ |; Memory Screencode Dump Output |edit memory screencode dump | | |output | +---------------------------------------------+--------------------------------+ |[ [Register] |show/edit first part of | | |registers | +---------------------------------------------+--------------------------------+ |] [Register] |show/edit second part of | | |registers | +---------------------------------------------+--------------------------------+ -------------------------------------------------------------------------------- Assemble Enter assembler code. The syntax is: a Adress [Opcode] The first form shows the adress again in the next line where you can enter the opcode. After a line was entered the next adress is shown one line below. There you can continue with your code: a c000 a00C000 a9 00 lda #$00 a00C002 Note Register size   If the 'follow Rep/Sep' is active the size of the akku and indexregisters is adjusted if one of this opcodes is entered. The M and X flags of the processor status are not altered by this. The default numeric system for all numbers is Hex. -------------------------------------------------------------------------------- Compare Compare two memory areas and print the differences. If the 'verbose mode' is active not only the adresses are shown but also the different contents. The syntax is: c Area Destination Destination is the start of the memory block which should be compared to Area. The default numeric system for all parameters is hex. -------------------------------------------------------------------------------- Disassemble Disassembles a memory area. If the 'follow Rep/Sep' mode is active the akku and indexregister size is adjusted if one of these opcodes occurs. The M and X flag of the processor status are not altered by this. The syntax is: d Range Tip The output of the 'd' command can be edited. -------------------------------------------------------------------------------- Fill Fill a memory area with bytes. The syntax is: f Area Pattern Pattern is a list of parameters seperated by commata. It describes the byte pattern Area should be filled with. It amy contain numbers of any length (byte, word, long) and strings, which must be identified by quotation marks. Example: The memory area from $1000 to $3000 should be filled with the text "hallo!", which is terminated by a zero byte. f 1000 3000 "hallo!",0 The default numeric system for all parameters is hex. Tip Strings can contain not only petascii-chars. Press a letter on the keyboard together with the Ctrl key. It appears inverted on the screen. Now DreaMon recognizes it as screencode. -------------------------------------------------------------------------------- Go Exit the DreaMon and jump to the specified adress. The syntax is: g Adress The default numeric system of Adress is Hex. -------------------------------------------------------------------------------- Hunt Searches a number of bytes in a memory area. A hit is reported by the adress. The syntax is: h Area Wildpattern Wildpattern is similar to the fill command's pattern. It is a list of numbers, strings and '?' seperated by commata. The numbers can be up to 3 bytes long (byte, word and long). '?' has the meaning of any number. Hex, bin and oct numbers can also contain '?'. Example: h 1000 1100 f? ...searches for all bytes which upper nibble is $f. This is not possible with dez as the seperate digits do not define clearly the used bits. Example: h e000 10000 "basic" ...searches for the string 'basic' (like in the c64 startup screen) h 8000 9fa0 "ab",?,"d" ...searches for a byte sequence with the char 'a' as the first byte, 'b' as second and 'd' as fourth one. The third byte may have any value. h 2300 2600 fff? ...searches for $ff00 bis $ffff. h a000 c000 d,"ok",d,0 ...searches for the string return, 'ok', return, which is terminated by a zero. (This is a message from the basic rom) Tip Strings can contain not only petascii-chars. Press a letter on the keyboard together with the Ctrl key. It appears inverted on the screen. Now DreaMon recognizes it as screencode. -------------------------------------------------------------------------------- Ascii and Screencode dump Shows the contents of a memory area with ascii or screencodes. The syntax is: i Range for ascii dump j Range for screen dump Tip The number of printed bytes per line can be defined with the 'pt' command. The output of both commands can be edited. -------------------------------------------------------------------------------- Load Loads a program into the memory. Load works across bank borders and has no problems with files larger than 64K. During the process the current adress is shown up to which the file is already loaded. The syntax is: l "Filename" [,Device [,Loadadress]] If the file's startadress should be ignored the desired one can be defined with Startadress. Load can be interrupted with the stop key. The default numeric system for Device is Dec! For Startadresse it is Hex. -------------------------------------------------------------------------------- Load FKeys Loads a definition for the FKeys. During the process the current adress is shown up to which the file is already loaded into the textbuffer. The Syntax is: lf "Filename" [,Device] 'Load FKeys' can be interrupted with the stop key. The default numeric system for Device is Dec! -------------------------------------------------------------------------------- Load Labels Loads labels. During the process the current adress is shown up to which the file is already loaded into the textbuffer. Caution Caution   Before the new labels are loaded, all old ones are deleted! The Syntax is: ll "Filename" [,Device] 'Load Labels' can be interrupted with the stop key. The default numeric system for Device is Dec! -------------------------------------------------------------------------------- Ascii and Screencode memory dump Shows the contents of a memory area with ascii or screencodes and the corresponding hex values. The syntax is: m Range for ascii memory dump n Range for screen memory dump Tip The number of printed Bytes per line can be defined with the 'pt' command. The output of both commands can be edited. -------------------------------------------------------------------------------- Opcode hunt Opcode hunt combines disassemble and hunt. It disassembles every single adress and searches through the output. A hit is reported by the Adress. If the 'verbose hunt' mode is active the disassembled line is also shown. The Syntax is: o Area Wildpattern The parameter Wildpattern is also used by the Hunt command. -------------------------------------------------------------------------------- Preferences Sets some preferences. -------------------------------------------------------------------------------- Dump and memdump output pt DumpLänge MemDumpLänge DumpLength is the number of bytes per line which will be printed by the ascii and screendump commands 'i' and 'j'. MemDumpLength is the same for the memory dump commands 'm' and 'n'. Only values which still fit on the screen are accepted. The default numeric system for both parameter is Hex. -------------------------------------------------------------------------------- I/O Device Defines the device used for memory access. 0 is the C64 and 8 to 31 are the serial bus devices. 'pi' defines the read and 'po' the write access. 'pio' combines both commands. pi ReadDevice po WriteDevice pio ReadDevice [WriteDevice] Examples: pi 8 m 300 ...shows the memory of floppy #8 at $300. pio 8 t 300 380 600 a 400 sei ...copies the memory of floppy #8 from $300 to $380 to $600. Afterwards the first line of an assembler programm is entered in the floppy memory. If 'pio' has only one parameter (like in this example) the read and write device are set to the same value. pio 0,8 t c00 e4c 300 pio 0 ...copies the C64's memory from $c00 to $e4c into floppy #8 to $300. The following 'pio 0' sets read and write access back to the C64's memory. The default numeric system for all parameter is Dec! -------------------------------------------------------------------------------- Select Mapping Mode Selects the mapping mode for adresses in commands. The Syntax is: pm [d | n | p | Bank [,ZeroPage]] By default DreaMon parses adresses without any change. m 0 shows the memory contents at $000000, no matter what the 'Direct-Page' register contains. This might be useful in some situations but gets annoying if the Program- or Data-Bank is not zero. In this case you have to enter every adress with 3 bytes to reach the desired bank. Here the 'Mapping Modes' come in handy. They map 1 or 2 byte long adresses on the fly. There are 4 modes:   * Data Bank and Zeropage   * Programm Bank   * custom values   * no Mapping Data Bank and Zeropage mapping. The 'Data Bank' register's actual value is added to 2 byte long adresses. The 'Direct Page' register's actual value is added to 1 byte long adresses. This mode is activated by the command pmd or the hotkey Ctrl+Shift+d. The 'Data Bank' register is displayed by the 'r' command marked with 'DB'. The 'Direct Page' register is marked 'DP'. r    PC    A    X    Y   SPTR NVMXDIZCE [00C4A7 FF01 0031 0009 01F2 001100010  DB  DP  01 ]08 E240 37 In this example the 'Data Bank' register contains $08 and the 'Direct Page' register $E240. For the Data Bank Mapping mode this leads to: m f0 :00E330 many bytes m 10C0 :0810C0 many bytes 3 byte long adresses are not changed by the mapping: m 0010C0 :0010C0 many bytes Programm Bank mapping. The 'Program Bank' register's actual value is added to 1 and 2 byte long adresses. This mode is activated by the command pmp or the hotkey Ctrl+Shift+p. The 'Program Bank' register is displayed by the 'r' command as the program counter's bankbyte (PC): r    PC    A    X    Y   SPTR NVMXDIZCE [15C002 8D91 0000 000C 01F8 001100110  DB  DP  01 ]00 E200 37 In this example it contains $15. For the Programm Bank Mapping mode this leads to: m f0 :1500f0 many bytes m 10C0 :1510C0 many bytes 3 byte long adresses are not changed by the mapping: m 0010C0 :0010C0 many bytes Mapping with custom values. In this mode the expansion for 1 and 2 byte long adresses can be set to any value. pm Bank ...expand 2 byte long adresses with Bank. 1 byte long adresses are not changed. Example: pm 82 m f0 :0000f0 many bytes m 10C0 :8210C0 many bytes pm Bank ,ZeroPage ...expand 2 byte long adresses with Bank. 1 byte long adresses are expanded with ZeroPage. Example: pm 82,1d80 m f0 :001E70 many bytes m 10C0 :8210C0 many bytes No Mapping. In this mode no adresses are expanded. This mode is activated by the command pmn or the hotkey Ctrl+Shift+n. The default numeric system for Bank and ZeroPage is Hex! -------------------------------------------------------------------------------- Registers Shows the registers: Akku, X, Y, processor flags, stack pointer, emulation flag, program counter, direct page, data bank, program bank and the content of $01. The syntax is: r -------------------------------------------------------------------------------- Save Saves a memory area. Save works across bank borders and has no problems with files larger than 64K. During the process the current adress is shown up to which the file is already saved. The syntax is: s "Filename" ,Device ,Range [,Loadadress] The file's standard load adress is the start of the memory area. If the file should later be loaded to a different location it can be defined with LoadAdresse. Save can be interrupted with the stop key. The default numeric system for Device is Dec! For all other parameter it is Hex. -------------------------------------------------------------------------------- Save FKeys Saves the defined FKeys. During the process the current adress is shown up to which the file is already saved. The Syntax is: sf "Filename" [,Device] 'Save FKeys' can be interrupted with the stop key. The default numeric system for Device is Dec! -------------------------------------------------------------------------------- Save Labels Saves the defined labels. During the process the current adress is shown up to which the file is already saved. The Syntax is: sl "Filename" [,Device] 'Save Labels' can be interrupted with the stop key. The default numeric system for Device is Dec! -------------------------------------------------------------------------------- Transfer Copies a memory area. The Syntax is: t Area Destination Destination is the start of the memory block Area should be copied to. Transfer works also without problems if Destination is inside of Area. The default numeric system for all parameter is Hex. -------------------------------------------------------------------------------- Verify Compares a memory block with the contents of a file. Verify works across bank borders and has no problems with files larger than 64K. During the process the adress is shown up to which the file is already compared. The syntax is: v "Filename" [,Device [,Loadadress]] The file is compared from its startadress on by default. Another position can be defined with LoadAdress. Verify can be interrupted with the stop key. The default numeric system for Device is Dec! For LoadAdress it is Hex. -------------------------------------------------------------------------------- Swap Exchanges two memory blocks. The syntax is: w Area Destination Destination is the start adress of the memory block which should be exchanged with Area. Swap works also without problems if Destination is inside of Area. The default numeric system for all parameter is Hex. -------------------------------------------------------------------------------- Exit Exits the DreaMon and continues at the current program counter. The syntax is: x The command can be expanded by a 't' which causes DreaMon to set a Freezepoint right after the actual program counter. This will trace one single opcode forward. xt DreaMon recognizes jump and branch commands on its own and decides for the branches if the appropriate condition is fulfilled. -------------------------------------------------------------------------------- Manage Freezepoints The command 'z' shows, sets or clears Freezepoints. 'z' without any parameters shows all Freezepoints. A Freezepoint is set by z Adress JumpTyp Aktion [Parameter] Please take a look at the Freezepoint chapter where you can find a closer description of all parameters. Freezepoints can also be set during assembly. You can find more about this also in the chapter Freezepoint. One single Freezepoint can be deleted with z Adress All Freezepoints can be deleted with z all The default numeric system for all parameter is Hex. -------------------------------------------------------------------------------- Dos commands The '@' sends a command to the serial bus or reads the status. If another device than the actual one should be used, it can be specified by '#Device' right behind the '@'. The default numeric system for Device is Dez. The command to be send can be enclosed in apostropes, but even spaces do not require this. Besides the normal dos commands which are understood by the floppies DreaMon knows the following special commands: +------------------------+----------------------------------+ |Command |Action | +------------------------+----------------------------------+ |@ $ |shows the directory | +------------------------+----------------------------------+ |@ me Adress |executes code in the floppy memory| +------------------------+----------------------------------+ |@ br Track Sector Adress|reads a sector from disk | +------------------------+----------------------------------+ |@ bw Track Sector Adress|writes a sector to disk | +------------------------+----------------------------------+ Except '$' the special commands are only executed without quotation marks. With quotation marks the text is just send to the floppy and no special command is executed. Caution Action-Replay owner   The parameter Adress for reading and writing sectors is a complete adress and not just a high-byte like known from the action replay. The default numeric system for Adress ist Hex. This command reads track 18, sektor 1 to $c000: @br 12 1 c000 Before a scratch or new command is executed, you have to confirm the operation. Examples: +-------+-----------------------------------------------------+ |@i |initialise the actual device | +-------+-----------------------------------------------------+ |@$ |show the actual drives directory | +-------+-----------------------------------------------------+ |@#10i |set the actual device to 10 and initialise it | +-------+-----------------------------------------------------+ |@ #10 i|...the same for space lovers | +-------+-----------------------------------------------------+ |@#9 |set the actual drive to 9 and show its status | +-------+-----------------------------------------------------+ |@#10$ |set the actual device to 10 and show the directory | +-------+-----------------------------------------------------+ -------------------------------------------------------------------------------- Chapter 4. General Usage Default numeric systems It always bugged me that most monitors insist on a '$' before a hex number though no other numeric system is supported. DreMon not only supports hex, dez, bin and oct but also has "default numeric systems". This is the system which is most common in a situation, e.g. hex while assembling. This system can be used without its prefix. Instead of a00C000 ldx #$c0 it's enough to enter a00C000 ldx #c0 DreaMon adds the missing '$' automatically. Hex is almost ever the default system. Exceptions are the devicenumber, where dez is default. Of course you can select everywhere another system by using the corresponding prefix: +--+----+ |! |Dez | +--+----+ |$ |Hex | +--+----+ |& |Oct | +--+----+ |% |Bin | +--+----+ Additionally all over the programm numbers can be described by any combination of binary, octal, decimal and hexadecimal as well as Label and terms. Read more about it in the chapter Terme. -------------------------------------------------------------------------------- Range Some commands have Range as a parameter, like 'd' or 'i'. This is a substitute for a bunch of adress-modes: +-------------+-------------------------------------------------+ |d |from actual adress in Scrollmode down | +-------------+-------------------------------------------------+ |d a000 |a single adress | +-------------+-------------------------------------------------+ |d a000 b000 |forward from $a000 to $b000 | +-------------+-------------------------------------------------+ |d b000 a000 |backwards from $b000 to $a000 (screen scrolls up)| +-------------+-------------------------------------------------+ |d =a000 |from $a000 on backwards in Scrollmode | +-------------+-------------------------------------------------+ |d a000= |from $a000 on forward in Scrollmode | +-------------+-------------------------------------------------+ |d a000 = b000|forward from $a000 to $b000 in Scrollmode | +-------------+-------------------------------------------------+ |d b000 = a000|backwards from $b000 to $a000 in Scrollmode | +-------------+-------------------------------------------------+ The default numeric system for all adresses is Hex. -------------------------------------------------------------------------------- Area An Area describes a block of memory by 2 values: the start- and the end adress. Both are seperated by one or more space. The end adress must be greater than the start adress. The default numeric system for all adresses is Hex. -------------------------------------------------------------------------------- Scrollmode The scrollmode enables you to browse easy and fast through the memory. After each line DreaMon waits for a key which can be one of these: +--------------+----------------------------------------+ |Cursor Up/Down|one step up/down | +--------------+----------------------------------------+ |Space |one step in actual direction | +--------------+----------------------------------------+ |Return |only in disass-mode: follow operand | +--------------+----------------------------------------+ |LeftArrow |return to adress before 'follow operand'| +--------------+----------------------------------------+ |+/- |next/previous byte | +--------------+----------------------------------------+ |d |switch to Disass mode | +--------------+----------------------------------------+ |i |switch to Acsii-Dump mode | +--------------+----------------------------------------+ |j |switch to Screen-Dump mode | +--------------+----------------------------------------+ |m |switch to Mem-Ascii-Dump mode | +--------------+----------------------------------------+ |n |switch to Mem-Screen-Dump mode | +--------------+----------------------------------------+ |Stop |leave Scrollmode | +--------------+----------------------------------------+ The Ctrl-Shift Keys are also active. 'follow operand' can be used 85 tiimes before a return adress gets lost. From the 86th time on the first return adress in each case gets lost. -------------------------------------------------------------------------------- Ctrl-Shift keys Next to the already known keys from the C64 - like Ctrl+Shift - some new (and I hope handy) keys are are introduced: +--------------------+---------------------------------------------------------+ |Ctrl+Shift+m |switch Akku 8/16 Bit (M flag is not touched) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+LeftArrow|Memory Mapping On/Off (aka Debug Mode. So hands off if | | |you don't know what you are up to ;) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+0 - 9 |Set $01 to #$3x (e.g.: Ctrl+Shift+5 is like lda #$35:sta | | |1) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+x |switch X/Y 8/16 Bit (X flag is not touched) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+f |follow Rep/Sep On/Off | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+h |'verbose hunt/opcodehunt' Modus An/Aus, zeige ein paar | | |mehr infos als nur die Adresse | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+v |switch VideoMode: (Vic, VDC 2531, VDC Super6 and ParDis | | |(Experimental)) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift++ |more lines (only VDC2531 and Super6) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+- |less lines (nur VDC2531 and Super6) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+Cursors |Move cursor to the screen borders (Ctrl+Shift+Down = move| | |to last line) | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+p |set mapping mode to 'program bank' | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+d |set mapping mode to 'data bank and zeropage' | +--------------------+---------------------------------------------------------+ |Ctrl+Shift+n |set mapping mode to 'none' | +--------------------+---------------------------------------------------------+ Ctrl+Shift+m and x only change internal flags for akku and register sizes. The M and X flag of the processor status is not altered. The videomode 'VDC2531' uses the 80 colums screen of a C128. Change the number of lines from 25 up to 31 with Ctrl+Shift++ and Ctrl+Shift+-. The 'super6' mode is similar to 'VDC2531' but uses another charset which is just 6 pixels high. This way more lines fit onto the screen. The total amount depends on your (hardware-) monitor. The number of lines is changes the same way as in the 'VDC2531' mode. As both modes use the VDC chip they are only available on a C128. -------------------------------------------------------------------------------- Label All label have to start with a '£'. A label is defined by £LabelName = Term The labelname may contain any char except one of the following: + * - / ( ) < > & UpArrow and Space The default numeric system for Term is Hex. To delete a label just skip Term. Example: Define the label "border" with the value $d020 £border = $d020 Define the label "Background" with the value $d021 £Background = £border +1 Delete the label "border" £border = The annoying spaces in these examples are of course unnecessary. -------------------------------------------------------------------------------- Enlarging numbers While assembling DreaMon normally selects the shortest possible adress-mode. But sometimes this is not desired (e.g. absolut should be used instead of zeropage). To specify a longer adress mode than a number normally has, this number has to be prefixed by enough zeros. Example: sta $fb should be absolut a00C000 sta 0fb A 3 digit hex number is already 2 bytes long and so absolut adressing is used. Of course this will also work: a00C000 sta 00fb But why wasting energy on senseless things? ;-) a00C000 sta 000fb is no more absolut adressing but long, as 5 hex nibble need 3 bytes. Of course this method of enlarging number works only for numeric systems where the number of digits clearly defines the length in bytes. That is the case with bin, hex and oct, but not with dez. If an argument consists of several numbers, the biggest enlarging is taken for the result. Note that Labels can be enlarged too. -------------------------------------------------------------------------------- F-Keys DreaMon knows more than the usual 8 FKeys. 8 more are accessed with the C= and the Ctrl key: +------------+--------------+ |C=+F1 : F9 |Ctrl+F1 : F10 | +------------+--------------+ |C=+F3 : F11 |Ctrl+F3 : F12 | +------------+--------------+ |C=+F5 : F13 |Ctrl+F5 : F14 | +------------+--------------+ |C=+F7 : F15 |Ctrl+F7 : F16 | +------------+--------------+ All FKeys except F16 can contain macros. To record a macro press F16. After that the cursor blinks faster than normal. Now press the FKey for the macro and start to type. Another hit on this FKey ends recording. A macro can contain other macros. Example: F1 should contain the text 'm 478' and Return. F16 F1 m 478 Return F1 Macros keep running over a system melt. -------------------------------------------------------------------------------- Freezepoints A Freezepoint interrupts the running program and jumps to the DreaMon. All registers of the I/O chips are saved so you can return to the program as nothing happened. There are 2 types of Freezepoints which are distinguished by their way how to jump to DreaMon: +-----+----------------+------+------------------------------------------------+ |Typ |Needs |Length|Condition | +-----+----------------+------+------------------------------------------------+ |J |the vectors at |3 |I/O must be active and the Freezepoint must | |(JSR)|$d3xx | |reside in bank 0 | +-----+----------------+------+------------------------------------------------+ |L |nothing |4 |none | |(JSL)| | | | +-----+----------------+------+------------------------------------------------+ The memory at the position of the freezepoint is saved and replaced by the jump command. So be sure not to get hit by self modification! (See below what to do in this case) After the freezepoint is executed the original memory is restored. While you are in the DreaMon you see the original memory. The disassemble command shows a little hint behind a line where a freezepoint resides. If a freezepoint is reached, 4 things can happen: +----------+---------------------+---------------------------------------------+ |Typ |Parameter |Action | +----------+---------------------+---------------------------------------------+ |N (Normal)|none |Springt einfach zum DreaMon | +----------+---------------------+---------------------------------------------+ |C (Count) |n (a number from 0 to|Freezes at the (n+1)-th time (so n=0 is like | | |$ff) |'normal') | +----------+---------------------+---------------------------------------------+ |A |n (a number from 0 to|activates the bits specified in n, nothing | |(Activate)|$ff) |more happens | +----------+---------------------+---------------------------------------------+ |R (Remote)|n (a number from 0 to|freezes if at least one bit from n is | | |$ff) |activated | +----------+---------------------+---------------------------------------------+ The default numeric system for all parameter is Hex. Activate and remote freezepoints only work together. They are used in cases of timing critical routines or self modification where the other types do not work. Remote freezepoints are not written to the memory if you set them. They are just kept in mind by DreaMon until the program hits an activate freezepoint. Now the remote freezepoint is written to the memory and can be executed! The parameter for both types is a bit mask to define which freezepoint is activated. If an activate point with parameter $15 is hit, all remote freezepoints are written to memory which have at least bit 0, 2 or 4 set in their parameter, e.g one with $32. There are two ways to set a freezepoint:   * While assembling or editing disassembled output The opcode at the position where you want to freeze has to be replaced by 'zJumpTyp Aktion' and a parameter for count, activate and remote. Example: This is the point where you want to freeze... >00c018 ad 20 d0 lda $d020 Now you type... >00c018 ad 20 d0 zjn;$d020 ...to set a 'normal' 'JSR' type (the semicolon after 'zjn' marks the end of the line. DreaMon ignores the rest behind it) >00c018 ad 20 d0 zlc12;$d020 ...to set a 'count' 'JSL' type, which freezes untill the 18. (=$12) time.   * With the 'z' command. Please take a look in the chapter manage freezepoints. -------------------------------------------------------------------------------- Terms Whenever a command expects a number it can be specified by a term. The following arithmetics may be used: +-------------+-----------------------+ |UpArrow, <, >|bank-, hi-, lo-byte | +-------------+-----------------------+ |mod |modulo | +-------------+-----------------------+ |*, / |multiply/divide | +-------------+-----------------------+ |+, - |add/subtract | +-------------+-----------------------+ |+, - |positive/negative sign | +-------------+-----------------------+ |>>, << |right/left shift | +-------------+-----------------------+ |@a |and | +-------------+-----------------------+ |@n |not | +-------------+-----------------------+ |@e |eor | +-------------+-----------------------+ |@o |or | +-------------+-----------------------+ The operations are listed by their priority. Brackets can override this. Example: All commands do the same m c002 m !49152+8>>2 m (8+4)*1000 + 2 -------------------------------------------------------------------------------- Appendix A. Past, present and future History 08.Mar.2001. The next semester started. More time for coding. ;) New:   + Updated the docs. Now all working commands are mentioned (I hope).   + Mapping modes   + Ctrl+Shift+p program bank mapping, Ctrl+Shift+d data bank and zeropage mapping Ctrl+Shift+n no mapping Debug mode set to Ctrl+Shift+LeftArrow Bugfix:   + Trace now uses long fp's in all cases which is more secure 07.Feb.2001. New:   + debug vector for long calls. Just insert 'jsl $00d304' somewhere in your code to wake up DreaMon. Bugfix:   + assembling branches did not work with $0 and $1 as destination adress.   + the assembler did not accept branches wrapping at the bank border Thanks to Stephan Andres for this bugreport!   + enter freezepoints directly (z 1234 ln) lost first char of adress 30.Jan.2001. New:   + Memory execute (@me adress), block read (@br track sector adress) block write (@bw track sector adress) Caution Action Replay owner   please note that the adress argument for block read and write is a full adress and not just a high byte like the action replay syntax. This reads track 18, sector 1 to $c000: '@br 12 1 c000' Bugfix:   + HW-regs enable and optimisation mode were not restored correctly   + E-flag was changed sometimes   + assembling a branch mnemonic filled the following byte with garbage Thanks to Stephan Andres for reporting this bug!   + tracing RTS, RTI and RTL did not work   + drivemem access now cares about errors like 'drive not present'   + the patched kernal rom (active with enabled hw-regs) was shown instead of the real one   + writing to $a000-$bfff and $e000-$ffff with $01=#$37 now changes the pseudo rom and not the ram below   + entering the debug mode just changed the VIC-border even if you were viewing a vdc screen   + remapped the scroll lock key from shift to ctrl This seems to make more sense as the scpu acts the same way 12.Jan.2001. Thanks to Stephan Andres for this bugreport! Bugfix:   + all adresses in pages $1d and $29 could not be used as operands for opcodes 22.Dez.2000. Only 2 days left till 24th. Happy, happy! Time for the DreaMon christmas edition. New:   + Left Shift and Scroll Lock act as scroll lock Bugfix:   + Errorchannel was cleared after a command sometimes Now the message always gets through 15.Dez.2000. This time I killed a funny bug. With enabled hw-regs it's possible to crash the scpu just by writing to some vic-regs. The Opcode must be located in the SRam at a special position in any page which depends on the number of the vic-reg. Sounds strange, hm? New:   + FKeys and Label Load/Save just append f or l to the load/save command (lf"fkeys",8) Bugfix:   + writing to Vic registers with enabled hardware-regs is unstable I have no idea why, so I just switched the hw-regs off before every vic access. 06.Dez.2000. Bugfix:   + E-Flag was not correctly set   + "Trace" and "Step In" ignored settings for Direct Page and Data Bank 27.Nov.2000. Thanks to Jolse for the ideas and reported bugs in this update! New:   + Ctrl+Shift+i inserts line, Ctrl+Shift+k kill line, Ctrl+Shift+c clear line   + default setting for F5 and F7 is now 'fast scroll up/down' Bugfix:   + a Range was always mistaken as scrollmode   + for some commands (like 'h') buffered mem access worked only for the first few bytes 06.Nov.2000. Phew, I passed the second block of tests at the end of my semester holydays! Long time no update, but this will become better. Er, I hope... New:   + Buffered memory access for all commands except freezepoints (needed for redirect)   + Redirect read/write to drive memory Bugfix:   + dump adress and memory contents were mixed up in bad situations   + inserted a ':' to fix this 17.Aug.2000. New:   + Trace command 'xt'   + Opcode Hunt speeded up a bit   + Warning message if DreaMon is started by an unknown FreezePoint. This happens if a FP is copied to another memory location. You have to delete the FP at the old location by hand (sorry).   + Check for VDC/PrLink before switching to that Video Mode. So (hopefully) no more crashes after some Ctrl+Shift+v and no PrDis daemon running.   + Disk operations at 20Mhz Bugfix:   + Counter FPs did not work with all Opcodes   + Redefining Labels and using other Labels in the definition screwed things up   + Opcodes 'AND' and 'OR' were mistaken as Math Operands in some situations. I had to change the Math Ops to '@a', '@o', '@n' and '@e' for 'and', 'or', 'not' and 'eor'. Sorry if you already got used to them.   + Delete at the start of a double-line did not work 19.Jul.2000. New:   + The installer is now packed with PuCrunch. Wow, almost 40% saved. Thanks to Pasi Ojala for this great tool! The depacker is a 65816 optimized version.   + Docs and history in english   + While disassembling in scroll mode you can follow the operand by hitting return. If the adressmode is something indexed or indirect the destination adress is calculated using the actual values of the registers.   + New display mode: PrDisplay It shows the DreaMon screen in a unix console using a parallel cable. So the C64 remains unchanged and the screen can be bigger (how about 80x50? :). You might have already guessed by the name that I'm using PrLink by Marko Mäkelä and Olaf Seibert. It's not completely done at the moment, but if anyone has a X1541, PC64 or prlink cable and a unix box I'd be happy to mail you the client. Just contact me. 07.Jul.2000. Hurray! Two of 3 tests are done. Now I can code without a bad feeling! New:   + Labels can be deleted by '£='   + 'p' sets one of the many prefs from inside the DreaMon. 'pt ,' sets the number of bytes per line for ascii/screencode dump and memory dump. Bugfix:   + Defining an empty FKey no more kills the following.   + '?argh' evaluated to $0a.   + funny data bank causes not a crash anymore 08.Jun.2000. Schon merkwürdig: Die Klausuren rücken immer näher, und obwohl ich noch _nichts_ gelernt habe, code ich viel mehr am DreaMon weiter, als im übrigen Semester. Es ist wohl doch etwas dran, dass am meissten Spass macht, was man nicht soll. ;-) New:   + Der erste Teil eines kleinen Setup-Tools ist fertig. Dort kann schnell die Position des DreaMons und des Buffers im Mem festgelegt werden. Die meissten I/O-Routinen sind dabei schon vom DreaMon, der sich danach einfach ohne den Setup-Krams verschiebt. Ich habe versucht, die gröbsten Fehler in der Eingabe abzufangen, wie z.B. Code überschreitet Bank-Grenze, Code und Text überschneiden sich, usw. Schaut doch bitte, was noch fehlt! Bugfix:   + Save müllt nicht mehr den ganzen Screen voll   + Viele kleine Fehler, die das Relocaten mit sich brachte... 18.Mai.2000. Bugfix:   + Beim Optimieren einiger Routinen stellte ich entsetzt fest, dass das Memory Mapping eigentlich nur durch Zufall funktioniert hatte, da ein Speicherbereich bis jetzt am Pagestart lag. Oops!   + Durch den Reloc-Krams klappten die Long-Freezepoints nicht mehr 26.Apr.2000. New:   + Der Umstieg auf den XA hat sich gelohnt. Der DreaMon ist jetzt im kompletten Super-Ram Byteweise verschiebbar! Nun fehlt mir nur noch ein kleines Interface, in dem man die gewünschte Position einstallen kann.   + Makro-Recording Das sollte eigentlich schon in die Symmek Version rein, aber ich habs nicht auf die Reihe bekommen. 15.Mar.2000. Im letzten Monat habe ich die meisste Zeit damit verbracht, das System zu wechseln. Ich code jetzt auf einer netten, kleinen Linux-Box mit dem XA. Leider musste ich mich von Acme verabschieden, da McBacon schon seit langem nichts mehr daran gemacht hat, und mit der momentanen Version die schon lange überfällige Verschiebbarkeit des DreaMons Höllenqualen für mich bedeuten würden. Bye, bye... New:   + Alle Argumente können ab sofort mathematische Terme mit Klammern sein. Die Klammerzahl ist beliebig, bzw. soviel eben in eine Zeile reingehen. ("...77, 78, 79!" :-)   + '? Term' zeigt Term als Hex, Dez, ASCII und Binär   + Mit '£' können Label definiert und benutzt werden 02.Feb.2000. New:   + Test, ob ein 65816 drin ist ohne Illegale Ops Bei fehlender SCPU kommt jetzt eine kleine CSW-Werbung. :-)   + Test, ob 65816 wirklich SCPU und nicht Flash8 ist Ob das läuft? Hm...   + Dieses putzige Historyfile ;-) Bugfix:   + Grösse des X/Y Registers wurde beim Assemblieren nicht berücksichtigt   + Dx0D-Read klappt endlich   + Freezen im Dezimal-Mode läuft auch -------------------------------------------------------------------------------- ToDo These are my plans for future versions of DreaMon:   * move the code and text buffer on the fly   * edit function for the frozen text screen   * use a Unix shell as a DreaMon screen, the data is transferred with the PrLink system.   * conditional freezepoints ...and your ideas! :) -------------------------------------------------------------------------------- Appendix B. Index A C D E F G H L M O P R S T V A. Area Ascii dump Ascii memory dump Assemble C. Command Index Compare Ctrl-Shift keys D. Default numeric systemse Disassemble Dos commands E. Enlarging numbers Exit F. Fill F-Keys Freezepoints G. Go H. History Hunt L. Label Load Load FKeys Load Labels M. Manage Freezepoints O. Opcode hunt P. Preferences R. Range Registers S. Save Save FKeys Save Labels Screencode dump Screencode memory dump Scrollmode Start Swap T. Terms ToDo Transfer V. Verify A C D E F G H L M O P R S T V