DASM
DASMIO::Address Class Reference

DCPU-16 assembler I/O functions for reading and writing address dumps. More...

List of all members.

Public Member Functions

Public Functions
retval new (scalar proto, scalar dasm)
 Create an object upon which we can work.
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 read (scalar self, scalar content, scalar filename)
 Read an address dump and populate our core.
retval write (scalar self)
 Write an address dump from our core.

Detailed Description

DCPU-16 assembler I/O functions for reading and writing address dumps.

Address dumps consist of address prefixed word values, eg:

  0000 : 1234

or multiple word values:

  0000 : 1234 5678 abce

Address dumps contain no symbols or relocation data. They are just text dumps of the content.

Definition at line 40 of file Address.pm.


Member Function Documentation

List the extensions we support.

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

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

Parameters:
[in]$selfAddress 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::Address::new ( scalar  proto,
scalar  dasm 
)

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::Address::read ( scalar  self,
scalar  content,
scalar  filename 
)

Read an address dump and populate our core.

Parameters:
[in]$selfAddress object
[in]$contentContent to parse
[in]$filenameFile it came from
retval DASMIO::Address::write ( scalar  self)

Write an address dump from our core.

In order to write an address dump, we need to force a resolve of all of the symbols. If there are any symbols that cannot be resolved, that's a fatal error - because they would write out as 0s.

Parameters:
[in]$selfAddress object
Returns:
Content to write

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