Commit 8b4f79d0 authored by John P. Willis's avatar John P. Willis

Begin work on console improvements

parent 5aae6eab
...@@ -165,7 +165,21 @@ sub console_output(port_number as ushort, value as ushort) ...@@ -165,7 +165,21 @@ sub console_output(port_number as ushort, value as ushort)
for i = CONSOLE_OFFSET to CONSOLE_LIMIT - 1 for i = CONSOLE_OFFSET to CONSOLE_LIMIT - 1
st_write_byte CONSOLE_PAGE, i, value st_write_byte CONSOLE_PAGE, i, value
next i next i
case (console_io_base + 5)
dim s_width as ushort
dim s_height as ushort
s_width = cpu_state.ga
s_height = cpu_state.gb
screenres s_width, s_height
if err > 0 then
message_print "console(): cannot set graphics mode"
cpu_set_flag FL_HALT
end if
end select end select
end sub ' console_output() end sub ' console_output()
...@@ -174,9 +188,8 @@ sub console_cycle_local(byval userdata as any ptr) ...@@ -174,9 +188,8 @@ sub console_cycle_local(byval userdata as any ptr)
do do
sleep sleep_duration, 1 sleep sleep_duration, 1
console_refresh_local
console_refresh_local
if bus_get_stop_flag(0) = 1 then exit do if bus_get_stop_flag(0) = 1 then exit do
loop loop
......
...@@ -756,7 +756,6 @@ function cpu_get_reg(register as ubyte) as ushort ...@@ -756,7 +756,6 @@ function cpu_get_reg(register as ubyte) as ushort
return cpu_state.go return cpu_state.go
case NREG_GP case NREG_GP
return cpu_state.gp return cpu_state.gp
case NREG_LA case NREG_LA
return (cpu_state.ga and LSB_MASK) return (cpu_state.ga and LSB_MASK)
case NREG_LB case NREG_LB
...@@ -767,7 +766,6 @@ function cpu_get_reg(register as ubyte) as ushort ...@@ -767,7 +766,6 @@ function cpu_get_reg(register as ubyte) as ushort
return (cpu_state.gd and LSB_MASK) return (cpu_state.gd and LSB_MASK)
case NREG_LE case NREG_LE
return (cpu_state.ge and LSB_MASK) return (cpu_state.ge and LSB_MASK)
case NREG_HA case NREG_HA
return (cpu_state.ga and MSB_MASK) shr 8 return (cpu_state.ga and MSB_MASK) shr 8
case NREG_HB case NREG_HB
...@@ -778,7 +776,6 @@ function cpu_get_reg(register as ubyte) as ushort ...@@ -778,7 +776,6 @@ function cpu_get_reg(register as ubyte) as ushort
return (cpu_state.gd and MSB_MASK) shr 8 return (cpu_state.gd and MSB_MASK) shr 8
case NREG_HE case NREG_HE
return (cpu_state.ge and MSB_MASK) shr 8 return (cpu_state.ge and MSB_MASK) shr 8
end select end select
end function ' cpu_get_reg() end function ' cpu_get_reg()
......
[console]
mode=local
@index
ILXI Interactive Commands
loadpage, lp - load memory segment from host file
savepage, sp - save memory segment to host file
writesect, ws - write sector to disk
assemble, a - interactively assemble instructions to a memory segment
disassemble, di - disassemble instructions in memory
step - single-step through a program
pushb - push a byte to the stack
pushw - push a word to the stack
getm - dump memory segments to the screen
setm - set the value of bytes or words in memory
getr - get the value of a CPU register
setr - set the value of a CPU register
dumpcpu, d - display the current state of CPU registers
trace - toggles instruction tracing
ver - display the current version of ILXI
run - run the CPU
reset - re-initialize the CPU
help - display online help topics
? - display this list of ILXI operations
exit, quit - exit ILXI
@loadpage
loadpage - Load a memory segment from host file
Syntax: [loadpage|lp] <host-file> <segment-number>
Details:
loadpage loads a single 64Kb segment from a memory image file
on the host machine. This can be a program, assembled with
the xiasm assembler, or generated from other ILXI compilers.
@lp
lp - see help for "loadpage"
@savepage
savepage - Save a memory segment to host file
Syntax: [savepage|sp] <host-file> <segment-index>
Details:
savepage saves a single 64Kb segment from ilxi into the specified
memory image file on the host. When used with the assemble command,
this allows the user to use ILXI as an interactive program development
environment.
@sp
sp - see help for "savepage"
@writesect
writesect - Write to one sector of an attached disk
Syntax: [writesect|ws] <segment-number> <offset> <channel> <track> <sector>
Details:
writesect writes data from segment-number:offset to the specified disk sector.
@ws
ws - see help for "writesect"
@assemble
assemble - interactively assemble instructions directly into memory
Syntax: assemble <origin>
Details:
assemble allows you to interactively assemble instructions into ILXI memory.
The starting address is EP:<origin>, where EP is the CPU's EP register.
@disassemble
disassemble - disassemble instructions in memory
Syntax: [disassemble|di] <starting-offset> <instruction-count>
Details:
disassemble will convert <instruction-count> instructions of machine code
starting at CP:<starting-offset>
@di
di - see help for "disassemble"
@step
step - single-step through program instructions
Syntax: step
Details:
step will advance the program counter register and execute the next instruction.
@getr
getr - get the value of a CPU register
Syntax: getr <register-name>
Details:
getr will return the value contained in the CPU register denoted by <register-name>
@setr
setr - set the value of a CPU register
Syntax: setr <register-name> <value>
Details:
setr will set the CPU register denoted by <register-name> to <value>
@pushb
pushb - push a BYTE value onto the stack
Syntax: pushb <byte-value>
Details:
pushb will push <byte-value> onto the stack, and update CPU registers
accordingly.
@pushw
pushw - push a WORD value onto the stack
Syntax: pushw <word-value>
Details:
pushw will push <word-value> onto the stack, and update CPU registers
accordingly.
@getm
getm - dump memory contents to screen
Syntax: getm <start-offset> <end-offset>
Details:
getm will display the contents of memory from DP:<start-offset> to
DP:<end-offset> on the screen.
@setm
setm - set the value of bytes or words in memory
Syntax: setm <offset> <value>
Details:
setm will write <value> to memory address DP:<offset>.
The <value> can be either a BYTE or a WORD.
@dumpcpu
dumpcpu - displays the state of CPU registers
Syntax: [dumpcpu|d]
Details:
The dumpcpu command will display the current contents of
all CPU registers and flags.
@d
See help for "dumpcpu"
@trace
trace - toggle program trace
Syntax: trace <value>
Details:
trace will turn program trace on and off. <value> can be
either 1 or 0, where 1 turns tracing on and 0 turns tracing off.
In program trace mode, the CPU will halt after each instruction,
something like an automated single-step.
@ver
ver - display the current version of ILXI
Syntax: ver
Details:
Displays the current version of ILXI.
@run
run - run the CPU
Syntax: run
Details:
The "run" command will start the CPU running at address CP:PC
@reset
reset - re-initialize the CPU
Syntax: reset
Details:
This command resets the CPU. The interrupt queue will be cleared,
registers zeroed, the INTERRUPT flag enabled, the ROM firmware reloaded,
the bus initialized, and signals initialized.
This command must be used in order to perform single-step operations
on a program after a program-generated HALT is encountered.
@help
help - display online help
Syntax: help <topic>
Details:
Displays online help topic <topic> on the screen.
@?
? - display list of help topics
Syntax: ?
Details:
Displays a list of available help topics
@exit
exit - exit the ILXI environment
Syntax: exit
Details:
Exits the ILXI environment.
@quit
See help for "exit"
@registers
ILXI CPU Registers
0 8 16
+-----------------+
| PC | PROGRAM COUNTER
+-----------------+
| EC | ERROR CODE
+-----------------+
| ES | ERROR SEVERITY
+-----------------+
| FL | FLAGS
+-----------------+
| CP | CODE PAGE
+-----------------+
| DP | DATA PAGE
+-----------------+
| EP | EXTRA PAGE
+-----------------+
| SP | STACK PAGE
+-----------------+
| SO | STACK OFFSET
+-----------------+
| SS | SOURCE PAGE
+-----------------+
| DS | DESTINATION PAGE
+-----------------+
| SI | SOURCE INDEX
+-----------------+
| DI | DESTINATION INDEX
+-----------------+
| BP | BASE POINTER
+--------+--------+
| LA | HA | GENERAL A
| GA |
+--------+--------+
| LB | HB | GENERAL B
| GB |
+--------+--------+
| LC | HC | GENERAL C
| GC |
+--------+--------+
| LD | HD | GENERAL D
| GD |
+--------+--------+
| LE | HE | GENERAL E
| GE |
+-----------------+
| GF | GENERAL F
+-----------------+
| GG | GENERAL G
+-----------------+
| GH | GENERAL H
+-----------------+
| GI | GENERAL I
+-----------------+
| GJ | GENERAL J
+-----------------+
| GK | GENERAL K
+-----------------+
| GL | GENERAL L
+-----------------+
| GM | GENERAL M
+-----------------+
| GN | GENERAL N
+-----------------+
| GO | GENERAL O
+-----------------+
| GP | GENERAL P
+-----------------+
@clear
clear - clear the screen
Syntax: clear
Details:
Clears the ILXI screen.
@cls
See help for "clear"
...@@ -73,7 +73,7 @@ sub do_asm(filename as string, page_number as integer) ...@@ -73,7 +73,7 @@ sub do_asm(filename as string, page_number as integer)
f = lookup_symbol(e.e_key) f = lookup_symbol(e.e_key)
if f.resolved = 1 then if f.resolved = 1 then
for j = 1 to s 'for j = 1 to s
end if end if
next i next i
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment