Our group chose option 2 for Lab 4 part 1.
1. what you need to know to solve this problem.
1) Text Area
- The emulator has a text area for data entry.- The checkbox labeled "Text Screen" can be used to hide the character display to free up more space - for editing code.
- The text box can display an 80x25 characters at $f000-$7cff, with one byte per pixel.
- One line has consisted from 00 to 4f.
- Printable ASCII characters will be displayed.
- If the high-order bit is set, the character will be shown in reverse video .
2) Routines
These routines are defined in ROM.
- SCINIT $ff81 - Initialize and clear the character display
- CHRIN $ffcf - Input one character from keyboard (returns A)
- CHROUT $ffdw - Outputs one character (A) to the screen at the current cursor position.
Screen will wrap/scroll appropriately. Printable characters and cursor code
($80/$81/$82/$83 for up/right/left/down) as well as RETURN ($0d) are accepted.
Printable ASCII codes with the high bit set will be printed in reverse video.
- SCREEN $ffed - Returns the character screen size in the X and Y registers.
- PLOT $fff0 - gets (CARRY=1) or sets (CARRY=0) the cursor position
- SCINIT $ff81 - Initialize and clear the character display
- CHRIN $ffcf - Input one character from keyboard (returns A)
- CHROUT $ffdw - Outputs one character (A) to the screen at the current cursor position.
Screen will wrap/scroll appropriately. Printable characters and cursor code
($80/$81/$82/$83 for up/right/left/down) as well as RETURN ($0d) are accepted.
Printable ASCII codes with the high bit set will be printed in reverse video.
- SCREEN $ffed - Returns the character screen size in the X and Y registers.
- PLOT $fff0 - gets (CARRY=1) or sets (CARRY=0) the cursor position
To use the ROM routines, these define directives may be pasted into your code:
define SCINIT $ff81 ; initialize/clear screen
define CHRIN $ffcf ; input character from keyboard
define CHROUT $ffd2 ; output character to screen
define SCREEN $ffed ; get screen size
define PLOT $fff0 ; get/set cursor coordinates
You can then access the routines by name using the
JSR
instruction:jsr CHROUT