Z80 Simulator IDE
External Modules Manual


Table Of Contents:

General info
z80simulatoride.server,

Functions and procedures
getmem, setmem, getio, setio, z80nmi, z80int, z80reset, gethalt, getinst, getcrystal, getclockcycles, geta, getf, getb, getc, getd, gete, geth, getl, getix, getiy, getsp, getpc, geti, getr, geta1, getf1, getb1, getc1, getd1, gete1, geth1, getl1,

External client/servers
objectinit, objectrefresh, writeio, readio, objectterm, External modules interface,


General info
Z80 Simulator IDE is an automation (ActiveX) server/client application. This feature enables communication with external simulation modules that can be developed by home developers and third parties using various Development Systems for Windows.

z80simulatoride.server
External client application can access Z80 Simulator IDE server services by creating an ActiveX object using z80simulatoride.server class.

Functions and procedures
Here is the list of functions and procedures available for external client applications:
- getmem
getmem(address) function will return the value in the memory location specified by 'address' argument [0-65535].
- setmem
setmem(address,value) procedure will put the 'value' argument [0-255] in the memory location specified by 'address' argument [0-65535].
- getio
getio(address) function will return the value on the I/O port specified by 'address' argument [0-255].
- setio
setio(address,value) procedure will put the 'value' argument [0-255] on the I/O port specified by 'address' argument [0-255].
- z80nmi
z80nmi() procedure with no arguments will generate NMI interrupt signal.
- z80int
z80int() procedure with no arguments will generate INT interrupt signal.
- z80reset
z80reset() procedure with no arguments will generate RESET signal.
- gethalt
gethalt() function with no arguments will return the HALT state [0-1].
- getinst
getinst() function with no arguments will return the mnemonics of last executed instruction [string].
- getcrystal
getcrystal() function with no arguments will return the clock frequency parameter [string].
- getclockcycles
getclockcycles() function with no arguments will return the number of clock cycles passed after the start of the simulation. The last two functions will enable the external client application to develop a real time behavior if needed.
- geta
geta() function will return the value in A register.
- getf
getf() function will return the value in F (flag) register.
- getb
getb() function will return the value in B register.
- getc
getc() function will return the value in C register.
- getd
getd() function will return the value in D register.
- gete
gete() function will return the value in E register.
- geth
geth() function will return the value in H register.
- getl
getl() function will return the value in L register.
- getix
getix() function will return the value in IX register.
- getiy
getiy() function will return the value in IY register.
- getsp
getsp() function will return the value in SP register.
- getpc
getpc() function will return the value in PC register.
- geti
geti() function will return the value in I register.
- getr
getr() function will return the value in R register.
- geta1
geta1() function will return the value in alternate A' register.
- getf1
getf1() function will return the value in alternate F' register.
- getb1
getb1() function will return the value in alternate B' register.
- getc1
getc1() function will return the value in alternate C' register.
- getd1
getd1() function will return the value in alternate D' register.
- gete1
gete1() function will return the value in alternate E' register.
- geth1
geth1() function will return the value in alternate H' register.
- getl1
getl1() function will return the value in alternate L' register.

External client/servers
Full support and full synchronization is available for external applications with client/server capabilities. External server module should provide the following procedures:

- objectinit
objectinit() procedure will be called at the beginning of the simulation in Z80 Simulator IDE. With this procedure external module should be initialized to a known initial state.
- objectrefresh
objectrefresh() procedure will be called after every simulated instruction.
- writeio
writeio(port,data) procedure will be called after every simulated OUT instruction and its arguments will be available for the external module.
- readio
readio(port,data) procedure will be called during the simulation of every IN instruction and the external module should assign the non-negative value [0-255] to the second argument (that should be addressed by reference and not by value) only if it is assigned to the specified port argument.
- objectterm
objectterm() procedure needs to contain the code to terminate external module application (typically End statement).

External modules interface
The class name should be set using External Modules interface available from Tools menu of Z80 Simulator IDE. External client/server applications will be started and terminated automatically with Z80 Simulator IDE.