Sharp logo
Entry points and work area 
IN WORK ( of the S-Basic MZ-2Z046 )  

The interpreter is loaded first to $1200 and next down by the monitor program from $1200 to commence at $0000.

The jump table at the start of the RAM Monitor has different addresses to the ROM Monitor ( see subroutines and workarea of the ROM Monitor 1Z-013A ), they are listed below, all addresses are in hex. Some appear to be unused while others are duplicated.

The tables show only a short description this time.
The information about the entry points of the interpreter's commands is listed only here.

The list of RAM Monitor and S-BASIC entry points and work area addresses is not a complete list, but it might assist those of you who are delving into the interpreter with your disassembler.

S-BASIC entry points / work area
Cold start monitor / BASIC
Get line to workarea addressed by DE ( unused, all calls to $004A )
New line
New line if the cursor isn't positioned at line begin
Print space
Print tab. Sets the cursor to the next tab position
Print character stored in Accu
Print message pointed to by DE ( unused, all calls to $0051 )
Execute software command
$001B check if key is pressed
$001E check if SHIFT-BREAK is pressed
Write info header to tape ($3ADD = RET!)
Write data to tape ($3ADD = RET!)
Read info header from tape ($3ADD = RET!)
Read data from tape ($3ADD = RET!)
Verify tape and program in RAM ($3ADD = RET!)
$00B2 = RET
Time set
$00B2 = RET
Read time
Set tempo
Melody stop
Melody stop
Get line from keyboard
$004D = $5800 Address of cold start Basic Interpreter
$004F addresses of error routines
$0058 keyboard request / get key

Control code address table. Contains the address to jump to after the "PRINT CHR$"-statement or a key with the CTRL-key down ( The "NOACT" shown there means it will effect in an immediate return ).

Address CTRL & Action
$00B2 @ NOACT
$00B2 A NOACT (free for turn to ASCII keyboard)
$00B2 B NOACT (free for switching the border color)
$09B0 C CR
$00B2 D NOACT (free for turn to German keyboard)
$0A1B E Shift Lock
$0A19 F Alpha mode
$00B2 G plotter new color
$00B2 H NOACT (free for switching the background color)
$A024 I TAB
$00B2 K NOACT (free for hardcopy)
$09B0 M CR
$1500 N stop / start print
$09CF Q Cursor down
$09F9 R Cursor up
$09D4 S Cursor right
$09FE T Cursor left
$0992 U HOME
$061D V CLR
$0A1E W Graphic mode
$0776 X INS
$0A19 Y Alpha mode
$00B2 Z NOACT (free for switching the character color)
$09B0 Ä CR
$00B2 ^ NOACT
$00B2 / NOACT

$009B CTRL routine
$00A8 disable interrupts
$00B3 enable interrupts
$00D3 POP AF, DE, BC, HL, IX
$00DA switch from monitor to RAM $E000 - $FFFF
$00E6 break without message, no CONT possible
$00ED handle errors, Accu contains error number
$00F6 compute length of text (DE), end = $00
$0104 output table (HL) to port (C) in the length of B
$010D compute ASCII value (HL) to hex DE. Check upper limit in B.
$011B Compare the bytes behind the CALL instruction with the contents of the Accu in the length of B
$012D Pick up an address from table (HL) to DE. HL = HL + 1
$0132 Pick up an address from table (HL) to DE. HL = HL
$0137 Clear memory (HL) with $00 in the length of B
$0138 Fill memory (HL) with the value in the accu in the length of B
$013D Clear memory (DE) with $00 in the length of B
$0143 Move memory from (HL) to (DE) in the length of B
$014A Move memory from (DE) to (HL) in the length of B
$0151 Pick up an address from table (HL) to HL.
$0158 HL = HL + A
$015D skip spaces
$0164 Compare the byte behind the CALL instruction with the contents of (HL)
$016E like $0164, but if not then error 1
$017C table of software commands
$022C execute software command
$0247 CALL (IX) and display error if any
$025E Compute hex value in HL to ASCII value (DE)
$029E Compute decimal or hex ASCII (HL) to hex DE
$02CE Compute hex ASCII (HL) to hex DE
$02E9 Compute hex ASCII A to hex
$02F8 Wait on space key then next key
$0305 Wait on any key. If BRK key then break program execution
$0314 Store device table pointer DE and device number A
$031C Correct pointer to the I/O workarea, basic variables area, and strings area
$0323 Correct pointer to the basic variables area and strings area
$032A Correct pointer to the strings area
$0340 Print error. A contains error number
$0397 Move the actual device name to (HL)
$03B6 Text "error"
$03BE Set screen mode
$0419 Init palette register and set maximum of the scroll area
$0441 Init palette register and init base colors black/blue/red/white
$044F Set palette block number
$0476 Color code to palette register (B = color code, A = palette code number)
$048A Set character color to palette value in A
$0493 Set graphic color to palette value in A
$049C Correct the palette value in A for the max. resolution
$04AE Compute the values of start / end scroll coordinates then output these to the controller.
$04EF Set screen routines to 40 or 80 columns
$0531 Init routines using values from (HL)

Table values for setting to 40 or 80 columns

$05AD Print accu
$05CE Print accu on graphic screen
$05F9 Compute Y coordinates to DE
$0615 Get pointer to Y coordinate to HL
$061D CLR
$0671 Clear memory area
$06AC Reset scroll offset
$0776 INST
$0848 Scroll
$08E5 Change character at cursor position for flashing cursor
$092B Init keyboard and show cursor
$0945 Show cursor or character
$094D New cursor position by HL
$0963 Compute text cursor position in pseudo screen by coordinates from HL
$0977 Compute the graphic screen address by the actual cursor position
$0992 HOME
$099B New line, if the cursor position > 0
$09AB New line
$09CF Cursor down
$09D4 Cursor right
$09E3 Concatenate lines and scroll conditional
$09F9 Cursor up
$09FE Cursor left
$0A24 TAB
$0A24 Get line form keyboard to memory (DE)
$0AB4 BRK-key
$0ABB Fetch textline from screen into the input area
$0BA1 Check for kbd input. Statuscode returns in A.
$0B7B Check for kbd input again.
$0B8B Check for kbd input without rebounce.
$0BA1 Check for kbd input. Keycode returns in A
$0BAB Check if a function key is pressed. Get a character.
$0BC1 Check if kbd input has changed
$0BF6 Check for kbd input; returns ASCII
$0C75 Check if function key is used.
$0CAB Compute to ASCII key code
$0CEF Identify CTRL-key
$0D22 Check for BRK condition (SHIFT/BRK)
$0D30 KEY work area
$0D47 Key codes translation table
$0D8F CTRL keys translation table
$0D94 Print text (DE) depending on a Ctrl-code for upper-/lowercase output.
$0DC3 SHARP ASCII table of lowercase letters
$0DDD CRT-device table
$0DF6 KEY device table
$0E0F Get kbd line and compute line length
$0E17 character in A
$0E26 get current screen X-value
$0E2A new line or CRT/LPT
$0E2C Print A to CRT/LPT. Ctrl codes will be executed.
$0E3A Print A to CRT/LPT. Ctrl codes will be displayed.
$0E48 Print text (DE) to CRT/LPT
$0E50 Print text (DE) to CRT. Ctrl codes will be executed.
$0E5F Print space to CRT
$0E61 Print A to CRT. Ctrl codes will be executed.
$0EA2 Print A to CRT. Ctrl codes will be displayed.
$0ED9 Ctrl code translation table for LPT output
$0EF9 Boot routine used by the Monitor/Basic
$0F2D identify the load device and set it to the actual device
$0F4E Check for graphic expansion option
$0F7F device table for USR routines
$0F98 prepare addresses for USR routines
$0FA7 USR device data I/O
$0FFC Music interrupt address
$0FFE Printer interrupt address
$1000 workarea for file attributes
$104A workarea for current device table
$1069 workarea for default device data
$1070 pointer workarea
$1082 cursor workarea
$11A4 workarea / inputarea
$12B2 text area of function keys
$1352 area for values of the current function key
$1369 current screen values

Go to the top of this page Home

last updated January 15, 2004