From 5f254d0d02d8d6d61ca57ef4188110f11032a930 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 20 Jul 2021 01:33:47 -0700 Subject: . Update run instructions for linux/app/ examples, and make sure they are correct. --- linux/apps/ex1.subx | 4 ++-- linux/apps/ex10.subx | 4 ++-- linux/apps/ex11.subx | 4 ++-- linux/apps/ex12.subx | 4 ++-- linux/apps/ex13.subx | 4 ++-- linux/apps/ex14.subx | 4 ++-- linux/apps/ex2.subx | 6 +++--- linux/apps/ex3.subx | 4 ++-- linux/apps/ex4.subx | 4 ++-- linux/apps/ex5.subx | 4 ++-- linux/apps/ex6.subx | 4 ++-- linux/apps/ex7.subx | 4 ++-- linux/apps/ex8.subx | 4 ++-- linux/apps/ex9.subx | 4 ++-- linux/apps/factorial.subx | 6 +++--- linux/apps/factorial2.subx | 6 +++--- linux/apps/factorial3.subx | 6 +++--- linux/apps/factorial4.subx | 6 +++--- 18 files changed, 41 insertions(+), 41 deletions(-) diff --git a/linux/apps/ex1.subx b/linux/apps/ex1.subx index 9661993d..d6c66200 100644 --- a/linux/apps/ex1.subx +++ b/linux/apps/ex1.subx @@ -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 diff --git a/linux/apps/ex10.subx b/linux/apps/ex10.subx index 71fa4c0e..987716c8 100644 --- a/linux/apps/ex10.subx +++ b/linux/apps/ex10.subx @@ -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 diff --git a/linux/apps/ex11.subx b/linux/apps/ex11.subx index dd16267d..434d824d 100644 --- a/linux/apps/ex11.subx +++ b/linux/apps/ex11.subx @@ -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, diff --git a/linux/apps/ex12.subx b/linux/apps/ex12.subx index b9708324..e8c3eb1c 100644 --- a/linux/apps/ex12.subx +++ b/linux/apps/ex12.subx @@ -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 diff --git a/linux/apps/ex13.subx b/linux/apps/ex13.subx index 28ab4694..42691bee 100644 --- a/linux/apps/ex13.subx +++ b/linux/apps/ex13.subx @@ -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 diff --git a/linux/apps/ex14.subx b/linux/apps/ex14.subx index b6be70d7..81520f90 100644 --- a/linux/apps/ex14.subx +++ b/linux/apps/ex14.subx @@ -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 diff --git a/linux/apps/ex2.subx b/linux/apps/ex2.subx index 342ec6c6..24803c61 100644 --- a/linux/apps/ex2.subx +++ b/linux/apps/ex2.subx @@ -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 diff --git a/linux/apps/ex3.subx b/linux/apps/ex3.subx index 6e1b71ef..aaeea039 100644 --- a/linux/apps/ex3.subx +++ b/linux/apps/ex3.subx @@ -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 diff --git a/linux/apps/ex4.subx b/linux/apps/ex4.subx index 59bf0649..2d47f016 100644 --- a/linux/apps/ex4.subx +++ b/linux/apps/ex4.subx @@ -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 diff --git a/linux/apps/ex5.subx b/linux/apps/ex5.subx index ec68b855..d7bab0ce 100644 --- a/linux/apps/ex5.subx +++ b/linux/apps/ex5.subx @@ -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 diff --git a/linux/apps/ex6.subx b/linux/apps/ex6.subx index d4e7a656..46cf045b 100644 --- a/linux/apps/ex6.subx +++ b/linux/apps/ex6.subx @@ -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 diff --git a/linux/apps/ex7.subx b/linux/apps/ex7.subx index 99f01e0d..2d521a55 100644 --- a/linux/apps/ex7.subx +++ b/linux/apps/ex7.subx @@ -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 diff --git a/linux/apps/ex8.subx b/linux/apps/ex8.subx index 318f6dee..363c0b90 100644 --- a/linux/apps/ex8.subx +++ b/linux/apps/ex8.subx @@ -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' diff --git a/linux/apps/ex9.subx b/linux/apps/ex9.subx index e1d2bf74..aa678db8 100644 --- a/linux/apps/ex9.subx +++ b/linux/apps/ex9.subx @@ -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 diff --git a/linux/apps/factorial.subx b/linux/apps/factorial.subx index e36f892d..d7e75821 100644 --- a/linux/apps/factorial.subx +++ b/linux/apps/factorial.subx @@ -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'. diff --git a/linux/apps/factorial2.subx b/linux/apps/factorial2.subx index 95450b3a..7569519a 100644 --- a/linux/apps/factorial2.subx +++ b/linux/apps/factorial2.subx @@ -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'. diff --git a/linux/apps/factorial3.subx b/linux/apps/factorial3.subx index deb30377..2b7da63b 100644 --- a/linux/apps/factorial3.subx +++ b/linux/apps/factorial3.subx @@ -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'. diff --git a/linux/apps/factorial4.subx b/linux/apps/factorial4.subx index 0707cfdd..c66aadf2 100644 --- a/linux/apps/factorial4.subx +++ b/linux/apps/factorial4.subx @@ -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'. -- cgit 1.4.1-2-gfad0