| 1 | #!/usr/local/bin/perl -w | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # $Id$ | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 4 | ▶ | use CPU::Z80::Assembler; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 4 | $CPU::Z80::Assembler::verbose = 1; | |||||||||||||||||||||||||||
| 9 | 4 | $CPU::Z80::Assembler::fill_byte = 0xFF; | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 4 | my $version = $CPU::Z80::Assembler::VERSION; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 4 | print STDERR "CPU::Z80::Assembler - z80masm v$version\n\n"; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 4 | my($infile, $outfile) = splice(@ARGV, 0, 2); | |||||||||||||||||||||||||||
| 16 | 4 | ▶ | defined($infile) && @ARGV == 0 | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $infile and @ARGV == 0
MC/DC0%0/2
defined $infile and @ARGV == 0
defined $infile
@ARGV == 0
Truth table33%1/3
A and B
A= defined $infileB= @ARGV == 0
| |||||||||||||||||||||||||||||
| 17 | or die "Usage: z80masm sourcefile [destfile]\n"; | ||||||||||||||||||||||||||||
| 18 | 4 | ▶ | $outfile ||= "$infile.o"; | ||||||||||||||||||||||||||
|
Condition50%1/2
$outfile ||= "$infile.o"
MC/DC0%0/1
$outfile ||= "$infile.o"
$outfile
Truth table50%1/2
A
A= $outfile
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 4 | my $code = z80asm_file($infile); | |||||||||||||||||||||||||||
| 21 | 4 | ▶ | open(OUT, ">$outfile") || die("Can't open $outfile\n"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 4 | binmode(OUT); | |||||||||||||||||||||||||||
| 23 | 4 | print OUT $code; | |||||||||||||||||||||||||||
| 24 | 4 | close(OUT); | |||||||||||||||||||||||||||
| 25 | 4 | exit 0; | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | =head1 NAME | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | z80masm - a macro assembler for the Z80 micro-processor | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | A simple wrapper around the CPU::Z80::Assembler perl module | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | z80masm sourcefile | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | z80masm sourcefile destfile | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =head1 USAGE | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | The source file is mandatory. The destination file, if not | ||||||||||||||||||||||||||||
| 44 | specified, will be the same as the source file, with .o appended. | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | For details of the assembler language, see | ||||||||||||||||||||||||||||
| 47 | L<CPU::Z80::Assembler>. | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | =head1 BUGS and FEEDBACK | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | See L<CPU::Z80::Assembler>. | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | L<CPU::Emulator::Z80> | ||||||||||||||||||||||||||||
| 56 | L<CPU::Z80::Assembler> | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | =head1 AUTHORS, COPYRIGHT and LICENCE | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | See L<CPU::Z80::Assembler>. | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | =cut | ||||||||||||||||||||||||||||