use Data::SExpression qw/consp scalarp/;
use Scalar::Util qw/looks_like_number/;
-our $VERSION = '0.002';
+our $VERSION = '0.003';
our %TYPES = (
LIST => 0,
my ($self, $fh) = @_;
$fh //= \*STDOUT;
+ die "addr_bits + type_bits >= 16\n"if $self->{addr_bits} + $self->{type_bits} > 16;
+
my $length = @{$self->{memory}};
print $fh pack('n', $length);
for (@{$self->{memory}}) {