[ROOT] --> Emulator

class I8080Environment

Environment for the I8080 CPU emulator.

This class implements all input/output functions for the I8080 emulator class, that is it provides functions to access the system RAM, ROM and I/O ports.

An object (instance) of this class corresponds to a system that has no RAM, ROM or ports: users of the I8080 emulator should provide the desired behaviour by writing a descendant of this class that overrides the required functions.

Author:
Alessandro Scotti

Source:
i8080.h:35

Constructors Index

I8080Environment
[public] Constructor.
~I8080Environment
[public] Destructor.


Methods Index

readByte
[public] Reads one byte from memory at the specified address.
readPort
[public] Reads one byte from the specified port.
readWord
[public] Reads a 16 bit word from memory at the specified address.
writeByte
[public] Writes one byte to memory at the specified address.
writePort
[public] Writes one byte from the specified port.
writeWord
[public] Writes a 16 bit word to memory at the specified address.


Constructors

I8080Environment

public I8080Environment ( ) ;

Constructor.

The object created by this base class corresponds to a system with no RAM, ROM or ports.

I8080Environment

public virtual ~ I8080Environment ( ) ;

Destructor.


Methods

readByte

public virtual unsigned char readByte ( unsigned addr ) ;

Reads one byte from memory at the specified address.

The address parameter may contain any value, including values greater than 0xFFFF (64k), so if necessary the implementation must check for illegal values and handle them according to the implemented system specifications.

Parameters:
addr address of memory byte to read

Return:
the content of the specified memory address

readWord

public virtual unsigned readWord ( unsigned addr ) ;

Reads a 16 bit word from memory at the specified address.

The address parameter may contain any value, including values greater than 0xFFFF (64k), so if necessary the implementation must check for illegal values and handle them according to the implemented system specifications.

The default implementation uses readByte(), so it is not strictly necessary to override this method.

See Also:
readByte

writeByte

public virtual void writeByte ( unsigned addr ,
                                unsigned char value ) ;

Writes one byte to memory at the specified address.

The address parameter may contain any value, including values greater than 0xFFFF (64k), so if necessary the implementation must check for illegal values and handle them according to the implemented system specifications.

Parameters:
addr address of memory byte to write
value value to write at specified address

writeWord

public virtual void writeWord ( unsigned addr ,
                                unsigned value ) ;

Writes a 16 bit word to memory at the specified address.

The address parameter may contain any value, including values greater than 0xFFFF (64k), so if necessary the implementation must check for illegal values and handle them according to the specifications of the emulated system.

The default implementation uses writeByte(), so it is not strictly necessary to override this method.

Note: the low order byte is placed at the lowest address.

See Also:
writeByte

Parameters:
addr address of memory word to write
value 16-bit value to write at specified address

readPort

public virtual unsigned char readPort ( unsigned port ) ;

Reads one byte from the specified port.

Note: the port value is always between 00h and FFh included.

Parameters:
port address of port to read

Return:
the value of the specified port

writePort

public virtual void writePort ( unsigned port ,
                                unsigned char value ) ;

Writes one byte from the specified port.

Note: the port value is always between 00h and FFh included.

Parameters:
port address of port to write
value value to write to specified port

This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.