The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CPU::Z80::Assembler::Segment - Represents one segment of assembly opcodes

SYNOPSIS

  use CPU::Z80::Assembler::Segment;
  my $segment = CPU::Z80::Assembler::Segment->new(
                                        name => $name,
                                        address => 0,
                                        line => $line,
                                        child => [$opcode, ...]);
  $self->add(@opcodes);

DESCRIPTION

This module defines the class that represents one continuous segment of assembly instruction opcodes CPU::Z80::Assembler::Opcode.

EXPORTS

Nothing.

FUNCTIONS

new

Creates a new object, see Class::Struct.

child

Each child is one CPU::Z80::Assembler::Opcode object.

name

Get/set of segment name.

address

Get/set of base address of the segment.

line

Get/set the line - text, file name and line number of the start of the segment.

add

Adds the opcodes to the segment. The line of the first opcode added is copied to the segment for error messages.

BUGS and FEEDBACK

See CPU::Z80::Assembler.

SEE ALSO

CPU::Z80::Assembler CPU::Z80::Assembler::Line CPU::Z80::Assembler::Opcode Class::Struct

AUTHORS, COPYRIGHT and LICENCE

See CPU::Z80::Assembler.