CPU::Z80::Assembler::List - Assembly listing output class
use CPU::Z80::Assembler::List; my $lst = CPU::Z80::Assembler::List->new(input => $asm_input, output => \*STDOUT); $lst->add($line, $address, $bytes); $lst->flush();
This module handles the output of the assembly listing file. It is fead with each assembled opcode and generates the full assembly list file on the given output handle.
If output is undef, does not generate any output.
my $lst = CPU::Z80::Assembler::List->new(input => $asm_input, output => \*STDOUT);
Creates a new object, see Class::Struct.
input is the input as passed to z80asm, i.e. list of text lines to parse or iterators that return text lines to parse.
output is the output file handle to receive the listing file. It can be an open file for writing, or one of the standard output file handles.
If output is undefined, no output is generated.
$self->add($line, $address, $bytes);
Adds a new opcode to the output listing. Receives the opcode Asm::Preproc::Line, address and bytes. Generates the output lines including this new opcode.
The output is held in an internal buffer until an opcode for the next line is passed to a subsequent add() call.
The last output line is only output on flush() or DESTROY()
Dumps the current line to the output. Called on DESTROY().