Skip to content

Commit

Permalink
Updated example to show expected output & etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Jul 2, 2018
1 parent 7c31654 commit 653725e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion examples/trap.box.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
#
# About:
#
# Prompt for a string and then output it, surrounded by a series of
# stars!
# stars. This demonstrates trap 0x1 (read from stdin) and trap
# 0x02 (strip newline).
#
# Usage:
#
# $ go.vm run ./trap.box.in
#
# Or compile, then execute:
#
# $ go.vm compile ./trap.box.in
# $ go.vm execute ./trap.box.raw
#
# Example:
#
# If the user enters "Steve" they will see the following output:
#
# *********
# * Steve *
# *********

store #1, "Please enter your name:"
print_str #1

Expand All @@ -13,9 +31,11 @@
# The following trap removes the newline from the string in #0
int 0x02

# Call a subroutine to output the boxed result
call box
exit


#
# This function prints out the string in #0 in a box. For example if the input
# string in #0 is "Steve" the output will be:
Expand Down

0 comments on commit 653725e

Please sign in to comment.