home *** CD-ROM | disk | FTP | other *** search
- COMVIEW USERS MANUAL
-
- by Rick Nash
-
- Load COMVIEW as you would any
- BASIC program, then simply type RUN to
- start. At this point you will see the
- main screen. It consists of two
- parts. On the top is a window divided
- into three parts. The upper left
- window shows the current state of the
- 6502 registers. The lower left window
- shows six bytes from any three memory
- location in the computer. The right
- window shows the current contents of
- the hardware stack. At this point,
- don't worry if you don't understand
- any of this. It will become clear as
- we begin to use different features of
- COMVIEW.
-
- The bottom window (Main window) is
- the business end of COMVIEW. This is
- where most of the work gets done.
- Things like the memory command, the
- assembler and disassembler use this
- window for data entry and display. At
- this point, a title message appears in
- this window. Let us now turn our
- attention to the MAIN MENU. Press the
- Commodore key and M simultaneously.
-
- ---------------
- THE MAIN MENU
- ---------------
-
- At this point, the main menu is
- displayed. Note the characters inside
- the square brackets. These are the
- "HOT" keys that are available while
- this menu is shown. You can either
- use the UP and DOWN CRSR keys to
- choose your selection, then press
- RETURN, or press the hot key for your
- choice. In the tutorials, we will use
- the following mnemonics for making
- menu selections:
-
- [MAIN-T] - means press the T hot
- key on the MAIN menu.
-
- Menu items followed by ellipses
- (...) means that a sub-menu will open.
-
-
- From all but the MAIN menu, the
- back arrow is used as an escape key.
- Pressing the escape key will halt
- almost all operations (except quick
- trace). Pressing the escape key from
- a menu, will take you to the previous
- menu. Some menus offer a "quick" exit
- key that will zoom to the MAIN menu.
- This option is clearly marked on menus
- that support it. The remainder of
- this manual will describe all of the
- options and features of COMVIEW.
-
- ---------------
- THE HELP MENU
- ---------------
-
- Pressing [MAIN-H] will present the
- HELP menu. There are three help
- screens avaliable:
-
- [HELP-G] - Will display a short
- synopsis of legal keystrokes and
- general information about COMVIEW.
-
- [HELP-I] - Will bring up the
- instruction set help menu. Select the
- instruction using the UP, DOWN, LEFT
- and RIGHT arrow keys. Then press
- RETURN to enter your choice. A window
- will open with full information on the
- chosen instruction. This window
- offers a ZOOM key (the RETURN key) to
- zoom to the main menu.
-
- [HELP-C] - Brings up the
- conversion table. This table a
- consists of five columns: DEC, HEX,
- BINARY, ASCII and SCREEN CODES. Use
- this for base conversions or
- ASCII/SCREEN codes. Active keys are
- the UP and DOWN CRSR keys and F7,
- which will move forward one page.
-
- Remember: to back out of anything,
- press the BACK ARROW (COMVIEW escape
- key).
-
- ---------------------
- FILL MEMORY COMMAND
- ---------------------
-
- Pressing [MAIN-I] will initiate
- the fill memory command. This command
- is used to initialize a section of
- memory to a given value. Note that
- you can change ANY memory location,
- including where COMVIEW is residing,
- so use this command carefully. Three
- requesters will prompt you for the
- starting, ending and fill byte. A
- requester is a white box that appears
- and asks for user input. Enter the
- information, and press RETURN, or use
- the escape key to cancel. After the
- third requester, the memory will be
- filled.
-
-
- -------------
- PREFERENCES
- -------------
-
- Pressing [MAIN-P] will show the
- preferences menu. This menu allows
- you to set up defaults for the way
- COMVIEW acts. At this time, only two
- entries are found on the preferences
- screen:
-
- [PREFS-S] - Will enable/disable
- screen-swapping. Screen-swapping is
- covered under the trace command.
-
- [PREFS-R] - Will enable/disable
- repeating keys. This will be noticed
- on commands such as the MEMORY command
- [MAIN-M].
-
- Note the parentheses after each
- item. If a large dot is shown, then
- the feature is ENABLED, otherwise it
- is DISABLED.
-
- -------------
- DISASSEMBLE
- -------------
-
- The disassemble command [MAIN-D],
- will show a section of memory in
- machine language mnemonic form. A
- requester will ask for the starting
- address, and then start the
- disassembler. Active keys are the UP
- and DOWN CRSR keys (meaning forward
- and backward scrolling disassembly),
- and of course the escape key. Note
- that disassembling a data table will
- produce garbage mnemonics (watch the
- ASCII field), but if real ML follows
- the table, the disassembler will right
- itself after several bytes. Here is a
- sample disassembled line:
-
- A B C D E
- ------------------------------
- EACD C0 41 CPY #$41 ;-A
-
- field a = hexadecimal address
-
- b = machine bytes (hex)
- c = mnemonic disassembly
- d = operand
- e = ASCII representation
-
- ----------
- ASSEMBLE
- ----------
-
- The assemble [MAIN-A] command
- allows you to enter machine language
- mnemonics into memory. Note that this
- command does not pretend to be a REAL
- assembler (see ROCK'S ASSEMBLER,
- published on LOADSTAR #87). Rather,
- it allows you to quickly and easily
- enter small chunks of code. It does
- however offer a few niceties such as
- limited labels, decimal or hex
- operands and several pseudo-ops.
- After entering the address at the
- requester, you are placed at the main
- window with the address listed, and a
- flashing cursor. COMVIEW is waiting
- for a line of machine code to be
- entered, such as:
-
- LDA #$00 <RETURN>
-
- or
-
- LDA #0 <RETURN>
-
- After pressing RETURN, the line is
- converted to machine code and inserted
- into memory. The next address is
- shown, and the process continues. The
- DEL key can be used to erase any
- mistakes before pressing the RETURN
- key. Errors are flagged by an error
- window that pops up above the main
- window. The error is described, and
- the line is shown with an arrow
- pointing at the infraction. Pressing
- C will allow you to continue entering
- mnemonics.
-
- PSEUDO OPS
-
- Pseudo ops are mnemonics for the
- assembler, not the 6502. Three
- Pseudo's are legal:
-
- ORG address - change the current
- address
-
- BYT value - enter the byte (or
- word) at the current location
-
- WOR value - enter the current
- word (hex or decimal)
-
- (note: BYT $1234 and WOR $1234
- will produce like output, 34 12)
-
-
- --------
- LABELS
- --------
-
- Limited labels are supported.
- Use labels only on RELATIVE branch
- instructions. A minus (-) followed by
- the character 0-9 for backwards
- branches, and a plus (+) followed by
- the character 0-9 for forward
- branches.
-
- For example:
-
-
-
-
- LDX #0
- -0 TXA
- CPX #40
- BEQ +8
- STA $C100,X
- INX
- BNE -0
- +8 RTS
-
- This nonsense code demonstrates
- the use of forward and backward
- labels. Note that the + and - are not
- mathematical, they simply are mnemonic
- for forwards and backwards. You must
- keep track of all labels. Since there
- is no source code, any label that
- scrolls from the screen will be lost
- forever, so jot down your labels. Any
- forward label not referenced will NOT
- be flagged! This is handled by making
- the branch point to itself. For
- example:
-
- C020 BNE +5
-
- Will be installed as:
-
- C020 BNE $C020 a
- until the +5 is referenced again.
- If you forgot to reference it, an
- endless loop will result. If your
- program hangs, this is probably why.
- Consider yourself warned!
-
- To stop the assembler, just press
- the escape key.
-
-
- ----------
- REGISTER
- ----------
-
- The register command [MAIN-R] is
- used to set the initial value of the
- .A, .X or .Y registers (register names
- will be preceded with a period in this
- manual). When selected, a requester
- will prompt for a register value.
- After pressing RETURN, you will notice
- a highlighted bar over the .A register
- in the register window on the upper
- left of your screen. The value shown
- will be the number you typed in. If
- you move the bar with the UP or DOWN
- CRSR keys, note that your number
- "floats" above the previous register
- values. Position the bar over the
- register you want to change, then
- press RETURN. This places your value
- into the register. As usual, you can
- press the escape key to exit without
- changing any registers.
-
-
- --------
- MEMORY
- --------
-
- Pressing the memory command
- [MAIN-M], will allow you to enter
- values directly into any memory
- location. When selected, you are
- prompted for an address with the usual
- requester. The following display will
- show the main window, with the memory
- displayed starting at the address you
- specified. There will be a
- non-flashing cursor showing your
- location in memory. Note that there
- are three fields for each line. The
- first field is the hex address. The
- next field shows eight bytes of
- memory, starting at that address,
- represented in hex. The last field
- shows the same eight bytes as
- represented in ASCII. Non-displayable
- ASCII such as control codes are shown
- as periods. You can change any byte
- by using the cursor keys to move the
- cursor to the desired byte, and type
- the hex digit (0-9 and A-F). There is
- no need to press RETURN to enter the
- digit. The UP and DOWN CRSR keys will
- allow you to scroll forward and
- backward through memory. The F7 key
- will change fields. If you are on the
- hex fields, pressing F7 will move the
- cursor to the ASCII fields. Pressing
- F7 on the ASCII fields will place the
- cursor on the hex fields. While on
- the ASCII field, you can press any key
- (except of course, the cursor keys and
- the F7 key). This allows quick entry
- of ASCII data tables. Press the
- escape key at any time to quit the
- memory mode.
-
-
- -------
- WATCH
- -------
-
- The watch command, [MAIN-W] is
- used to set a watch point. A watch
- point allows you to watch a memory
- location during the tracing feature of
- COMVIEW. The watch window is located
- directly under the register window at
- the top of the screen. Three memory
- locations of six bytes each may be
- watched. The field layout is the same
- as the MEMORY command above, except
- that six bytes are shown instead of
- eight. Operation is similiar to the
- register command ([MAIN-R]). After
- entering the address at the requester,
- a "floating" bar will allow you to
- place the desired address at any one
- of the three possible locations.
- Press RETURN to make your choice, or
- escape to quit.
-
-
- -------------
- BREAK POINT
- -------------
-
- The break point is used in
- conjunction with the QUICK TRACE
- option [MAIN-Q]. The current
- breakpoint is shown in the register
- window at the top of the screen, with
- the label: BP=. After selecting BREAK
- POINT, a requester prompts for an
- address. After pressing RETURN, note
- that value in the register window
- should reflect the address that you
- just entered. See QUICK TRACE for
- more information on BREAK POINTS.
-
-
- -------
- TRACE
- -------
-
- The TRACE feature [MAIN-T] is the
- HEART of COMVIEW. It will allow you
- to execute your program one
- instruction at a time. After each
- instruction is executed, the REGISTER,
- WATCH and STACK windows are updated so
- that you can see the internal workings
- of the computer in action. In
- addition, if screen-swapping is
- enabled, the alternate screen is
- swapped in when your instruction
- executes, and back out when it is
- done. This feature allows you to use
- instructions that use the screen
- without fear of clobbering the COMVIEW
- screen. It does, however, create
- unsightly screen flicker. For best
- performance, be sure to disable
- screen-swapping (use [MAIN-P]
- [PREFS-S] to toggle screen-swapping on
- and off) if your program does not use
- the screen. If the COMVIEW screen
- gets written to by accident, use the
- UPDATE [MAIN-U] command to freshen the
- COMVIEW display. The F3 key is used
- to toggle the swapped screens.
-
- After answering the address
- requester when starting the trace
- mode, the first address is disasembled
- on the main window. COMVIEW is now
- waiting for one of three keystrokes.
- SPACE will execute the instruction
- shown, then disassemble the next
- instruction, and the process
- continues. The J key can be used if
- the current instruction is a JSR. It
- will call the routine, and continue
- execution with the next instruction
- after the JSR. This is called
- "stepping over" a call.
- Alternatively, you could press SPACE
- at the JSR call, and this is called
- "stepping through" a call. Do you see
- the difference? Pressing J at the JSR
- calls the routine, SPACE will execute
- each instruction at the JSR address.
- Note, that for convenience, the J key
- acts like SPACE for any instruction
- that is not a JSR. While stepping
- through the program watch the windows
- at the top of the screen. You will
- gain great insight on the actions of
- the microprocessor. As usual, the
- escape key will exit the trace
- function.
-
- Note: The tracer may not function on
- any RS-232 functions. You may find
- that it chokes on certain KERNAL or
- ROM calls. This is due to the fact
- that the NMI interrupt is used for the
- trace feature.
-
-
- -------------
- QUICK TRACE
- -------------
-
- The quick trace [MAIN-Q] works
- like the TRACE feature, except that
- the tracing operation is automatic.
- That is, you do not press keys to
- control the tracing action -- it is
- automatic. Press any of the shifting
- keys (Commodore, CONTROL, SHIFT or
- SHIFT LOCK) to pause the display. The
- STOP key can be used to abort the
- quick trace at any time. At that
- point, you will be left in the normal
- trace mode. This command should be
- used to skip over unwanted code, to
- get to a point where you want to
- trace.
-
- WARNING! You MUST use the BREAK
- POINT [MAIN-B] command BEFORE using
- the quick trace command! If you
- ignore this warning, bad things will
- surely happen. So the sequence of
- events should be:
-
- 1) Set the breakpoint to the
- address that you want quick trace to
- stop at (make sure that the address
- will be executed).
-
- 2) Set or clear the screen swap
- flag if needed.
-
- 3) Use QUICK TRACE to execute your
- program.
-
- Follow these steps, and everything
- will be copacetic!
-
- ------
- CALL
- ------
-
- The call command [MAIN-C] allows
- you to do the equivalent of a SYS
- (JSR) from the keyboard. After the
- address requester, your routine will
- be executed. The screen is swapped if
- swapping is enabled. The registers,
- stack and watch windows, reflect their
- status at the exit from the routine.
-
- WARNING! You MUST have an RTS
- instruction at the end of the code you
- are executing, or you risk crashing
- the computer!
-
- ----
- GO
- ----
-
- The go [MAIN-G] command executes a
- program. Execution continues until a
- BRK instruction. As with the CALL
- command, screen swapping, register,
- stack and watch windows are updated.
-
- WARNING! The code executed MUST
- end with a BRK instruction. A crash &
- burn is a definite possibility if you
- don't heed this warning!
-
- ------
- FILE
- ------
-
- The file command [MAIN-F] will
- open a sub-menu with the following
- options:
-
- [FILE-S] - Allows you to save your
- ML programs to disk. Enter the
- filename, start and end addresses when
- prompted.
-
- [FILE-L] - Use this option to load
- machine language files from disk. You
- can relocate while LOADing or, when
- prompted for an address, you can just
- press RETURN, and the file will load
- at the address from where it was
- saved.
-
- [FILE-V] - Will verify that the
- file on disk is the same as the
- program in memory.
-
- [FILE-D] - Shows the current
- directory. Press STOP to abort, or
- one of the SHIFT keys to pause.
-
- [FILE-U] - Opens a sub-menu for
- changing the device number. The
- current device is always displayed on
- the main file window.
-
- [FILE-E] - Shows the current disk
- error message.
-
- -------------
- VIEW OUTPUT
- -------------
-
- The View Output option [MAIN-V],
- allows you to examine the current
- state of the output window. It works
- like the F3 key during the Trace mode.
- After viewing the screen, press any
- key to return to the Main menu.
-
- ----------
- GLOSSARY
- ----------
-
- 6502/6510 - The family of
- microprocessors found in most
- Commodore computers.
-
- ACCUMULATOR - A register located in
- the microprocessor, where all of the
- math gets done. On the 6502, the
- register is named A.
-
- ASSEMBLER - A program that converts
- assembly language mnemonics into
- machine code. Many other features are
- usually offered in an assembler to
- help machine language programmers cope
- with their task.
-
- ASSEMBLY LANGUAGE - Since a
- microprocessor only understands
- numbers (see machine language), it
- would be very tedious for programmers
- to write machine code programs. So
- the designers of the chips invented
- "mnemonics", or three letter words
- that describe the machine instructions
- in terms more easily understood by
- humans. Which makes more sense to
- you, LDA, or 10101001? It is
- important that you understand that
- mnemonics like LDA are completely
- meaningless to the micro. They are
- for human consumption only. The list
- of mnemonics for a given
- microprocessor is said to be its
- assembly language. (See assembler).
-
- BINARY - A numbering system with a
- base of 2. Only 1's and 0's are valid
- in this numbering system. Ex: 101
- binary = 5 decimal, 1111 binary = 15
- decimal.
-
- BIT - One binary digit (0 or 1).
-
- BYTE - On the C-64, a byte is eight
- binary digits (or bits). It can hold
- a number from 0 (00000000 binary) to
- 255 (11111111 binary).
-
- HEXADECIMAL - A numbering system with
- a base of 16. The numbers 0-9
- represent their decimal equivalent,
- while A-F represents the numbers 10-15
- respectively. Ex: 0A hex = 10
- decimal, 10 hex = 16 decimal.
-
- K - Short for KILOBYTE, or 1024 bytes.
-
-
- MACHINE LANGUAGE - The native language
- understood by a microprocessor. Since
- each memory location can only hold
- numbers, (0-255), then it seems
- logical that instructions to the
- microprocessor must be numerical. It
- turns out that different numbers
- instruct the micro to do different
- tasks. These numbers are called
- opcodes, and are the "machine
- language" of a microprocessor such as
- the 6502. (see assembly language)
-
- MEMORY - Special chips located in the
- computer can hold information. In the
- C-64, this information is a number
- from 0 to 255, or a byte. These bytes
- must be in some kind of order, or else
- the computer couldn't find bytes that
- it needs. So, each byte has an
- "address", the number of addresses is
- limited by the type of microprocessor
- installed in the computer. The 6510 in
- your C-64 can access 64K, or 65536
- bytes of memory. The address of each
- byte is linear, ie. from address 0 to
- address 65535, and each address can
- hold a single byte. Some memory is
- lost when you turn off the computer
- (RAM), and some will never go away
- (ROM). Some addresses in your
- computer are neither RAM nor ROM.
- This memory is known as I/O registers.
- These registers allow the computer to
- communicate with other things like the
- video display, the sound chip, the
- disk drive, modems etc. I/O means
- Input/ Output, or input to the
- computer, or output to some other
- device. The microprocessor sees these
- I/O locations for the most part like
- RAM.
-
- MICROPROCESSOR - The microprocessor,
- or micro, is the intelligence of the
- computer. By itself, it is pretty
- stupid, but add a program, and it
- really can get some work done fast.
- For instance, your 6510 in the C-64 is
- capable of adding two numbers together
- in around 6 microseconds (thats 6
- millionths of a second!), so your
- micro could add around 167,000 pairs
- of numbers in just 1 second! The
- acronym CPU (Central Processing Unit)
- is sometimes used to mean the same
- thing as a microprocessor.
-
- MICROSECOND - 1 millionth of a second
- (1/1,000,000 sec) or 1,000
- MILLISECONDS.
-
- MILLISECOND - 1 thousandth of a second
- (1/1,000 sec)
-
- MNEMONIC - (pronounced knee mon ick)
- According to my dictionary, a mnemonic
- is "Aiding or designed to aid the
- memory". Designers of microprocessors
- invent mnemonics that briefly describe
- each machine language instruction.
- This is used to aid humans in
- remembering the instruction set of a
- given microprocessor. For the 6502,
- all mnemonics are three characters in
- length, and usually "sound" like the
- job they do. For example: LDA means
- load the accumulator (most ML
- programmers pronounce LDA as LoaD A).
- Mnemonics are important to humans, not
- micros. Microprocessors only
- understand numbers. (see assembly
- language)
-
- OPCODE - An opcode is a number that
- corresponds to a machine language
- instruction. For example, 169 is the
- 6502 opcode for the mnemonic LDA.
-
- RAM - Memory in the C-64 that can be
- read from, and written to. RAM is an
- acronym for Random Access Memory.
-
- REGISTER - A memory location located
- in the microprocessor. This memory
- location is not within the 64K of
- memory of the computer. It can be
- accessed only by special instructions.
-
- ROM - Memory whose contents are
- permanently the same value. Its value
- even survives without power. ROM is
- an acronym for Read Only Memory
-
- RN - Acronym for Registered Nurse,
-
- Really Nice or, in this case, my
- initials. Usually placed at the end
- of text.
-
- **** End Of Text ****
-