X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FScheme79asm.pm;h=f76b834ea6c463ae7b4a03dce6baaf097612a358;hb=ab8f838ff57d83083716775abf1c121430da5e5e;hp=19e249c88cc74becdaf00795bd9ef59ce9cb0ae1;hpb=7d76d131c08bd5eaa82c7c9c3a561166dd586abe;p=app-scheme79asm.git diff --git a/lib/App/Scheme79asm.pm b/lib/App/Scheme79asm.pm index 19e249c..f76b834 100644 --- a/lib/App/Scheme79asm.pm +++ b/lib/App/Scheme79asm.pm @@ -8,7 +8,7 @@ use Data::Dumper qw/Dumper/; use Data::SExpression qw/consp scalarp/; use Scalar::Util qw/looks_like_number/; -our $VERSION = '0.003'; +our $VERSION = '0.004'; our %TYPES = ( LIST => 0, @@ -70,11 +70,9 @@ sub process { die 'Computed addr is not a number: ', Dumper($addr), "\n" unless looks_like_number $addr; - if (ref $type eq 'Data::SExpression::Symbol') { + if (!looks_like_number $type) { die "No such type: $type\n" unless exists $TYPES{$type}; $type = $TYPES{$type}; - } elsif (!looks_like_number $type) { - die "Type is not a number or symbol: $type\n" } $addr += (1 << $self->{addr_bits}) if $addr < 0; @@ -315,6 +313,13 @@ Parse a sequence of S-expressions and lay it out in memory. Can be called multiple times to lay out multiple sequences of S-expressions one after another. +=item $asm->B(I<$sexp>) + +Given an already-parsed sexp (meaning a +L object), lay it out in memory. +Can be called multiple times to lay out multiple sequences of +S-expressions one after another. + =item $asm->B Move the last pointer to position 5, and put the free pointer at