Skip to content

Commit

Permalink
Move the example 'hello.pasm' from assembly to pasm.
Browse files Browse the repository at this point in the history
Added a test for hello.pasm.


git-svn-id: https://svn.parrot.org/parrot/trunk@9511 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
bschmalhofer committed Oct 18, 2005
1 parent 28da31c commit ae3a641
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
Expand Up @@ -446,7 +446,6 @@ examples/README [main]doc
examples/assembly/Makefile [main]doc
examples/assembly/acorn.l [main]doc
examples/assembly/hanoi.pasm [main]doc
examples/assembly/hello.pasm [main]doc
examples/assembly/hello-dwim.imc [main]doc
examples/assembly/io1.pasm [main]doc
examples/assembly/io2.pasm [main]doc
Expand Down Expand Up @@ -600,6 +599,7 @@ examples/mops/mops.scheme [main]doc
examples/pasm/99beer.pasm [main]doc
examples/pasm/cat.pasm [main]doc
examples/pasm/fact.pasm [main]doc
examples/pasm/hello.pasm [main]doc
examples/pir/euclid.pir [main]doc
examples/pir/mandel.pir [main]doc
examples/pir/sudoku.pir [main]doc
Expand Down
22 changes: 11 additions & 11 deletions config/gen/makefiles/root.in
Expand Up @@ -842,22 +842,22 @@ examples-clean:
examples/assembly/mops.pbc \
examples/mops/mops$(O) \
examples/mops/mops$(EXE) \
examples/assembly/hello.pbc \
examples/assembly/hello$(O) \
examples/assembly/hello$(EXE)
examples/pasm/hello.pbc \
examples/pasm/hello$(O) \
examples/pasm/hello$(EXE)

# hello
hello: test_prep examples/assembly/hello$(EXE)
$(CUR_DIR)/examples/assembly/hello$(EXE)
hello: test_prep examples/pasm/hello$(EXE)
$(CUR_DIR)/examples/pasm/hello$(EXE)

examples/assembly/hello.pbc: examples/assembly/hello.pasm
$(PARROT) -o examples/assembly/hello.pbc examples/assembly/hello.pasm
examples/pasm/hello.pbc: examples/pasm/hello.pasm
$(PARROT) -o examples/pasm/hello.pbc examples/pasm/hello.pasm

examples/assembly/hello$(O): examples/assembly/hello.pbc
$(PARROT) -o examples/assembly/hello$(O) examples/assembly/hello.pbc
examples/pasm/hello$(O): examples/pasm/hello.pbc
$(PARROT) -o examples/pasm/hello$(O) examples/pasm/hello.pbc

examples/assembly/hello$(EXE): examples/assembly/hello$(O)
$(MAKE) EXEC=examples/assembly/hello exec
examples/pasm/hello$(EXE): examples/pasm/hello$(O)
$(MAKE) EXEC=examples/pasm/hello exec



Expand Down
2 changes: 1 addition & 1 deletion docs/intro.pod
Expand Up @@ -229,7 +229,7 @@ C<.local> is a type. This can be C<int> (for I registers), C<float> (for N
registers), C<string> (for S registers), C<pmc> (for P registers) or the name
of a PMC type.

=head2 PIR vs PASM
=head2 PIR vs. PASM

PIR can be turned into PASM by running:

Expand Down
4 changes: 0 additions & 4 deletions examples/assembly/hello.pasm

This file was deleted.

15 changes: 15 additions & 0 deletions examples/pasm/hello.pasm
@@ -0,0 +1,15 @@
# $Id$

=head1 NAME

hello.pasm - Hello World

=head1 DESCRIPTION

This is also used in the top Makefile,
for showing how to create an executable from PASM.

=cut

print "Hello World\n"
end
7 changes: 6 additions & 1 deletion t/examples/pasm.t
Expand Up @@ -28,11 +28,12 @@ F<t/examples/japh.t>
=cut

use strict;
use Parrot::Test tests => 1;
use Parrot::Test tests => 2;
use Test::More;

# Set up expected output for examples
my %expected = (

'fact.pasm' => << 'END_EXPECTED',
fact of 0 is: 1
fact of 1 is: 1
Expand All @@ -41,6 +42,10 @@ fact of 3 is: 6
fact of 4 is: 24
fact of 5 is: 120
fact of 6 is: 720
END_EXPECTED

'hello.pasm' => << 'END_EXPECTED',
Hello World
END_EXPECTED
);

Expand Down

0 comments on commit ae3a641

Please sign in to comment.