GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
CPU::Z80::Assembler::Program(3) User Contributed Perl Documentation CPU::Z80::Assembler::Program(3)

CPU::Z80::Assembler::Program - Represents one assembly program

  use CPU::Z80::Assembler::Program;
  my $program = CPU::Z80::Assembler::Program->new(
                    symbols => {},
                    macros  => {});
  $program->parse($input);
  $segment = $program->segment;
  $segment = $program->segment("CODE");
  $segment = $program->split_segment;
  $program->add_opcodes(@opcodes);
  $program->add_label($name, $line);
  $program->org($address);
  $bytes = $program->bytes;
  $list_output = CPU::Z80::Assembler::List->new(input => \@input, output => \*STDOUT);
  $bytes = $program->bytes($list_output);

This module defines the class that represents one assembly program composed of CPU::Z80::Assembler::Segment.

Nothing.

Creates a new object, see Class::Struct.

Each child is one CPU::Z80::Assembler::Segment object, in the order found in the program.

Hash of all symbols defined in the program. The key is the symbol name, and the value is either a scalar for a constant, a CPU::Z80::Assembler::Expr for an expression, or a CPU::Z80::Assembler::Opcode for a label.

Hash of macro names to CPU::Z80::Assembler::Macro objects for all defined macros.

  $program->parse($input);

Parse the assembly program and collect the opcodes into the object. $input is a stream of tokens as retrieved by CPU::Z80::Assembler "z80lexer".

Get/Set the current segment. The current segment is the one where new opcodes are added.

When called without arguments returns a CPU::Z80::Assembler::Segment object of the current segment.

When called with a $name, it sets the segment with the given name as current. If no such segment exists, a new segment with that name is appended to the list and set current.

Splits the current segment at the current position, creating a new segment, inserting it just after the current one and setting it as current.

Returns the new current segment.

As a special case, if the current is empty, then nothing is done.

This is used to split one segment in two after a second ORG statement.

Adds the opcodes to the current segment.

Add a new label at the current position with given name and line. The line is used for error messages and assembly listing.

It is an error to add a label twice with the same name.

Splits the current segment with split_segment() and sets the start address of the new current segment.

Allocate addresses for all child segments, starting at the first segment's "address" (defined by a "org" instruction), or at 0.

Computes the bytes of each segment, and concatenates them together. Returns the complete object code.

Gaps between segments are filled with $CPU::Z80::Assembler::fill_byte.

$list_output is an optional CPU::Z80::Assembler::List object to dump the assembly listing to.

See CPU::Z80::Assembler.

CPU::Z80::Assembler CPU::Z80::Assembler::Segment CPU::Z80::Assembler::Parser Class::Struct

See CPU::Z80::Assembler.
2019-07-06 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.