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
#
# To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex1.subx -o ex1
# $ bootstrap/bootstrap run ex1
# $ ./translate_subx 000init.subx apps/ex1.subx
# $ ./a.elf
# Expected result:
# $ echo $?
# 42

View File

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

View File

@ -6,8 +6,8 @@
# a null-terminated 'kernel string' with a size-prefixed 'SubX string'.
#
# To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex11.subx -o ex11
# $ bootstrap/bootstrap run ex11 # runs a series of tests
# $ ./translate_subx 000init.subx apps/ex11.subx
# $ ./a.elf # runs a series of tests
# ...... # all tests pass
#
# (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.
#
# To run:
# $ bootstrap/bootstrap translate 000init.subx apps/ex12.subx -o ex12
# $ bootstrap/bootstrap run ex12
# $ ./translate_subx 000init.subx apps/ex12.subx
# $ ./a.elf
# You shouldn't get a segmentation fault.
== code

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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