DASM
Private Attributes
DASMIO::Hardware Class Reference

DCPU-16 execution environment - hardware profile initialisation. More...

List of all members.

Private Member Functions

Public Functions
retval new (scalar proto, scalar dasm)
 Create an object upon which we can work.
retval register (scalar self, scalar address, scalar device, scalar args)
 Register a region of memory with a device.
retval identify (scalar self, scalar filename, scalar type)
 Identify whether we can handle reading or writing a given file by its filename.
retval extensions ()
 List the extensions we support.
retval parseline (scalar self, scalar line)
 Parse an instruction line.

Private Attributes

scalar debug_reg
 Whether we debug the registrations.

Detailed Description

DCPU-16 execution environment - hardware profile initialisation.

This module provides the initialisation of the hardware mapped devices in the core of the DCPU-16 emulation. The mappings are defined in a hardware profile which describes the base address of the devices.

Each device is implemented by a device module in the directory DExecHW. An instance of the devices is created and attached to the addresses through a DExecHWAdapter. The adapter supplies the offset parameter to the device object, allowing multiple registers to be easily implemented in the device, despite not being known to the execution environment.

The hardware profiles take the form of lines in a file of the form:

  <address> <device> [ '(' <arguments> ')' ]

Comments are prefixed by a '#' character.

Devices may be registered in multiple locations with different arguments.

Each device has a window size, which it defines. This is the number of registers it provides and which will be allocated in the core.

Definition at line 75 of file Hardware.pm.


Member Function Documentation

retval DASMIO::Hardware::extensions ( ) [private]

List the extensions we support.

Parameters:
[in]$selfOur object
Returns:
arrayref of extensions
retval DASMIO::Hardware::identify ( scalar  self,
scalar  filename,
scalar  type 
) [private]

Identify whether we can handle reading or writing a given file by its filename.

Parameters:
[in]$selfOur object
[in]$filenameFilename we're accessing
[in]$type'read' or 'write'
Return values:
1if we can access it
0if we cannot access it
retval DASMIO::Hardware::new ( scalar  proto,
scalar  dasm 
) [private]

Create an object upon which we can work.

Parameters:
[in]$protoPrototype object, or this class's name
[in]$dasmDASM object we're working on
Returns:
new object
retval DASMIO::Hardware::parseline ( scalar  self,
scalar  line 
) [private]

Parse an instruction line.

Parameters:
[in]$selfIO object
[in]$lineLine to process
retval DASMIO::Hardware::register ( scalar  self,
scalar  address,
scalar  device,
scalar  args 
) [private]

Register a region of memory with a device.

Parameters:
[in]$selfThis hardware object
[in]$addressThe address to assign the device at
[in]$deviceThe device name
[in]$argsarrayref of arguments for the device

Member Data Documentation

scalar DASMIO::Hardware::debug_reg [private]

Whether we debug the registrations.

Definition at line 80 of file Hardware.pm.


The documentation for this class was generated from the following file: