Update run instructions for linux/app/ examples, and make sure they are
correct.
This commit is contained in:
Kartik K. Agaram 2021-07-20 01:33:47 -07:00
parent 0b9ea19c98
commit 5f254d0d02
18 changed files with 41 additions and 41 deletions

View File

@ -4,8 +4,8 @@
# Same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html # Same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex1.subx -o ex1 # $ ./translate_subx 000init.subx apps/ex1.subx
# $ bootstrap/bootstrap run ex1 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 42 # 42

View File

@ -1,8 +1,8 @@
# String comparison: return 1 iff the two args passed in at the commandline are equal. # String comparison: return 1 iff the two args passed in at the commandline are equal.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex10.subx -o ex10 # $ ./translate_subx 000init.subx apps/ex10.subx
# $ bootstrap/bootstrap run ex10 abc abd # $ ./a.elf abc abd
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 0 # false # 0 # false

View File

@ -6,8 +6,8 @@
# a null-terminated 'kernel string' with a size-prefixed 'SubX string'. # a null-terminated 'kernel string' with a size-prefixed 'SubX string'.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex11.subx -o ex11 # $ ./translate_subx 000init.subx apps/ex11.subx
# $ bootstrap/bootstrap run ex11 # runs a series of tests # $ ./a.elf # runs a series of tests
# ...... # all tests pass # ...... # all tests pass
# #
# (We can't yet run the tests when given a "test" commandline argument, # (We can't yet run the tests when given a "test" commandline argument,

View File

@ -2,8 +2,8 @@
# Create a new segment using mmap, save the address, write to it. # Create a new segment using mmap, save the address, write to it.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex12.subx -o ex12 # $ ./translate_subx 000init.subx apps/ex12.subx
# $ bootstrap/bootstrap run ex12 # $ ./a.elf
# You shouldn't get a segmentation fault. # You shouldn't get a segmentation fault.
== code == code

View File

@ -1,8 +1,8 @@
# Compare 3 and 3. # Compare 3 and 3.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex13.subx -o ex13 # $ ./translate_subx 000init.subx apps/ex13.subx
# $ bootstrap/bootstrap run ex13 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 1 # 1

View File

@ -1,8 +1,8 @@
# Multiply 2 numbers. # Multiply 2 numbers.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex14.subx -o ex14 # $ ./translate_subx 000init.subx apps/ex14.subx
# $ bootstrap/bootstrap run ex14 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 6 # 6

View File

@ -1,11 +1,11 @@
# Add 3 and 4, and return the result in the exit code. # Add 3 and 4, and return the result in the exit code.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex2.subx -o ex2 # $ ./translate_subx 000init.subx apps/ex2.subx
# $ bootstrap/bootstrap run ex2 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 2 # 7
== code == code

View File

@ -1,8 +1,8 @@
# Add the first 10 numbers, and return the result in the exit code. # Add the first 10 numbers, and return the result in the exit code.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex3.subx -o ex3 # $ ./translate_subx 000init.subx apps/ex3.subx
# $ bootstrap/bootstrap run ex3 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 55 # 55

View File

@ -1,8 +1,8 @@
# Read a character from stdin, save it to a global, write it to stdout. # Read a character from stdin, save it to a global, write it to stdout.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex4.subx -o ex4 # $ ./translate_subx 000init.subx apps/ex4.subx
# $ bootstrap/bootstrap run ex4 # $ ./a.elf
== data == data

View File

@ -1,8 +1,8 @@
# Read a character from stdin, save it to a local on the stack, write it to stdout. # Read a character from stdin, save it to a local on the stack, write it to stdout.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex5.subx -o ex5 # $ ./translate_subx 000init.subx apps/ex5.subx
# $ bootstrap/bootstrap run ex5 # $ ./a.elf
== code == code
# instruction effective address register displacement immediate # instruction effective address register displacement immediate

View File

@ -1,8 +1,8 @@
# Print out a (global variable) string to stdout. # Print out a (global variable) string to stdout.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex6.subx -o ex6 # $ ./translate_subx 000init.subx apps/ex6.subx
# $ bootstrap/bootstrap run ex6 # $ ./a.elf
# Hello, world! # Hello, world!
== code == code

View File

@ -5,8 +5,8 @@
# the character read. # the character read.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex7.subx -o ex7 # $ ./translate_subx 000init.subx apps/ex7.subx
# $ bootstrap/bootstrap run ex7 # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 97 # 97

View File

@ -1,8 +1,8 @@
# Example reading commandline arguments: compute length of first arg. # Example reading commandline arguments: compute length of first arg.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex8.subx -o ex8 # $ ./translate_subx 000init.subx apps/ex8.subx
# $ bootstrap/bootstrap run ex8 abc de fghi # $ ./a.elf abc de fghi
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 3 # length of 'abc' # 3 # length of 'abc'

View File

@ -4,8 +4,8 @@
# letter of second arg. # letter of second arg.
# #
# To run: # To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex9.subx -o ex9 # $ ./translate_subx 000init.subx apps/ex9.subx
# $ bootstrap/bootstrap run ex9 z x # $ ./a.elf z x
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 2 # 2

View File

@ -1,14 +1,14 @@
## compute the factorial of 5, and print the result ## compute the factorial of 5, and print the result
# #
# To run: # To run:
# $ bootstrap/bootstrap translate [01]*.subx apps/factorial.subx -o factorial # $ ./translate_subx [01]*.subx apps/factorial.subx
# $ bootstrap/bootstrap run factorial # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 120 # 120
# #
# You can also run the automated test suite: # You can also run the automated test suite:
# $ bootstrap/bootstrap run factorial test # $ ./a.elf test
# Expected output: # Expected output:
# ........ # ........
# Every '.' indicates a passing test. Failing tests get a 'F'. # Every '.' indicates a passing test. Failing tests get a 'F'.

View File

@ -4,14 +4,14 @@
# rm32 operands # rm32 operands
# #
# To run: # To run:
# $ ./translate_subx init.linux [01]*.subx apps/factorial2.subx -o factorial # $ ./translate_subx init.linux [01]*.subx apps/factorial2.subx
# $ bootstrap/bootstrap run factorial # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 120 # 120
# #
# You can also run the automated test suite: # You can also run the automated test suite:
# $ bootstrap/bootstrap run factorial test # $ ./a.elf test
# Expected output: # Expected output:
# ........ # ........
# Every '.' indicates a passing test. Failing tests get a 'F'. # Every '.' indicates a passing test. Failing tests get a 'F'.

View File

@ -5,14 +5,14 @@
# function calls # function calls
# #
# To run: # To run:
# $ ./translate_subx init.linux [01]*.subx apps/factorial3.subx -o factorial # $ ./translate_subx init.linux [01]*.subx apps/factorial3.subx
# $ bootstrap/bootstrap run factorial # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 120 # 120
# #
# You can also run the automated test suite: # You can also run the automated test suite:
# $ bootstrap/bootstrap run factorial test # $ ./a.elf test
# Expected output: # Expected output:
# ........ # ........
# Every '.' indicates a passing test. Failing tests get a 'F'. # Every '.' indicates a passing test. Failing tests get a 'F'.

View File

@ -6,14 +6,14 @@
# control flow # control flow
# #
# To run: # To run:
# $ ./translate_subx init.linux [01]*.subx apps/factorial4.subx -o factorial # $ ./translate_subx init.linux [01]*.subx apps/factorial4.subx
# $ bootstrap/bootstrap run factorial # $ ./a.elf
# Expected result: # Expected result:
# $ echo $? # $ echo $?
# 120 # 120
# #
# You can also run the automated test suite: # You can also run the automated test suite:
# $ bootstrap/bootstrap run factorial test # $ ./a.elf test
# Expected output: # Expected output:
# ........ # ........
# Every '.' indicates a passing test. Failing tests get a 'F'. # Every '.' indicates a passing test. Failing tests get a 'F'.