From 966e29f871e9bf91390346ac982fc0fe41cc4197 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 19 Jan 2025 10:34:05 -0500 Subject: * --- awk/vm/vm_tests.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/awk/vm/vm_tests.sh b/awk/vm/vm_tests.sh index 8180de9..6244c51 100755 --- a/awk/vm/vm_tests.sh +++ b/awk/vm/vm_tests.sh @@ -8,12 +8,12 @@ echo "42 A! A A # Store 42 in A, then read A twice" | awk -f vm.awk echo echo "Test 2: Register A and B with memory operations" -echo "100 A! 200 B! 42 B !B @B # Store 100 in A, 200 in B, store 42 at B's address" | awk -f vm.awk +echo "100 A! 200 B! 42 @B # Store 100 in A, 200 in B, read from B's address" | awk -f vm.awk echo echo "Test 3: Sequential memory operations using P register" -echo "0 P! 1 !+ 2 !+ 3 !+ 4 !+ 5 !+ # Store 1-5 sequentially using P" | awk -f vm.awk -echo "0 P! @+ @+ @+ @+ @+ # Read back values using P" | awk -f vm.awk +echo "0 !P 1 !+ 2 !+ 3 !+ 4 !+ 5 !+ # Store 1-5 sequentially using P" | awk -f vm.awk +echo "0 !P @+ @+ @+ @+ @+ # Read back values using P" | awk -f vm.awk echo echo "Test 4: Complex register manipulation" @@ -21,16 +21,16 @@ echo "42 A! A DUP B! @B # Store 42 in A, copy to B, read via B" | awk -f vm. echo echo "Test 5: Register arithmetic" -echo "5 A! 3 B! A B! @B A + # Store 5 in A, 3 in B, add A + mem[B]" | awk -f vm.awk +echo "5 A! 3 B! A @B + # Store 5 in A, 3 in B, add A + mem[B]" | awk -f vm.awk echo echo "Test 6: Memory pointer operations" -echo "42 0 ! 1 P! @P # Store 42 at addr 0, point P to 1, read P" | awk -f vm.awk +echo "42 0 ! 1 !P @P # Store 42 at addr 0, point P to 1, read P" | awk -f vm.awk echo echo "Test 7: Register and memory interaction" -echo "10 A! 20 B! A B ! # Store A's value at B's address" | awk -f vm.awk -echo "B @ # Read value at B's address" | awk -f vm.awk +echo "10 A! 20 B! A @B ! # Store A's value at B's address" | awk -f vm.awk +echo "@B # Read from memory at B's address" | awk -f vm.awk echo echo "Test 8: Demonstrating B! vs !B" -- cgit 1.4.1-2-gfad0