about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--010vm.cc1
-rw-r--r--014indirect_addressing.cc20
-rw-r--r--vimrc.vim6
3 files changed, 13 insertions, 14 deletions
diff --git a/010vm.cc b/010vm.cc
index 85bb4478..e9c3f354 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -241,7 +241,6 @@ inline string mem_addr_string(uint32_t addr, uint32_t size) {
   return out.str();
 }
 
-
 inline void write_mem_u8(uint32_t addr, uint8_t val) {
   uint8_t* handle = mem_addr_u8(addr);
   if (handle != NULL) *handle = val;
diff --git a/014indirect_addressing.cc b/014indirect_addressing.cc
index fa6ae4ed..f14bc7ba 100644
--- a/014indirect_addressing.cc
+++ b/014indirect_addressing.cc
@@ -84,7 +84,7 @@ void test_add_mem_at_r32_to_r32_signed_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  03     18                                    \n" // add *EAX to EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "01 00 00 00\n"  // 1
   );
@@ -104,7 +104,7 @@ void test_add_mem_at_r32_to_r32_unsigned_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  03     18                                    \n" // add *EAX to EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "01 00 00 00\n"
   );
@@ -124,7 +124,7 @@ void test_add_mem_at_r32_to_r32_unsigned_and_signed_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  03     18                                    \n" // add *EAX to EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "00 00 00 80\n"  // smallest negative signed integer
   );
@@ -212,7 +212,7 @@ void test_subtract_mem_at_r32_from_r32_signed_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  2b     18                                    \n"  // subtract *EAX from EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "ff ff ff 7f\n"  // largest positive signed integer
   );
@@ -232,7 +232,7 @@ void test_subtract_mem_at_r32_from_r32_unsigned_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  2b     18                                    \n"  // subtract *EAX from EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "01 00 00 00\n"  // 1
   );
@@ -252,7 +252,7 @@ void test_subtract_mem_at_r32_from_r32_signed_and_unsigned_overflow() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  2b     18                                    \n"  // subtract *EAX from EBX
-      // ModR/M in binary: 11 (direct mode) 011 (src EBX) 000 (dest EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (src EBX) 000 (dest EAX)
       "== data 0x2000\n"
       "00 00 00 80\n"  // smallest negative signed integer
   );
@@ -583,7 +583,7 @@ void test_compare_r32_with_mem_at_rm32_lesser_unsigned_and_signed() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  3b     18                                    \n"  // compare EBX with *EAX
-      // ModR/M in binary: 11 (direct mode) 011 (lhs EBX) 000 (rhs EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (lhs EBX) 000 (rhs EAX)
       "== data 0x2000\n"
       "0d 0c 0b 0a\n"  // 0x0a0b0c0d
   );
@@ -602,7 +602,7 @@ void test_compare_r32_with_mem_at_rm32_lesser_unsigned_and_signed_due_to_overflo
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  3b     18                                    \n"  // compare EBX with *EAX
-      // ModR/M in binary: 11 (direct mode) 011 (lhs EBX) 000 (rhs EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (lhs EBX) 000 (rhs EAX)
       "== data 0x2000\n"
       "00 00 00 80\n"  // smallest negative signed integer
   );
@@ -621,7 +621,7 @@ void test_compare_r32_with_mem_at_rm32_lesser_signed() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  3b     18                                    \n"  // compare EBX with *EAX
-      // ModR/M in binary: 11 (direct mode) 011 (lhs EBX) 000 (rhs EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (lhs EBX) 000 (rhs EAX)
       "== data 0x2000\n"
       "01 00 00 00\n"  // 1
   );
@@ -640,7 +640,7 @@ void test_compare_r32_with_mem_at_rm32_lesser_unsigned() {
       "== code 0x1\n"
       // op     ModR/M  SIB   displacement  immediate
       "  3b     18                                    \n"  // compare EBX with *EAX
-      // ModR/M in binary: 11 (direct mode) 011 (lhs EBX) 000 (rhs EAX)
+      // ModR/M in binary: 00 (indirect mode) 011 (lhs EBX) 000 (rhs EAX)
       "== data 0x2000\n"
       "ff ff ff ff\n"  // -1
   );
diff --git a/vimrc.vim b/vimrc.vim
index c6b7b415..88951e78 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -84,7 +84,7 @@ if empty($TMUX) || (system("tmux display-message -p '#{client_control_mode}'") =
   "   can't put final cursor movement out of function because that disables the wait for <CR> prompt; function must be final operation of map
   "   can't avoid the function because that disables the wait for <CR> prompt
   noremap <Leader>t {:keeppatterns /^[^ #]<CR>:call RunTestMoveCursor("<C-r><C-w>")<CR>
-  function RunTestMoveCursor(arg)
+  function! RunTestMoveCursor(arg)
     exec "!./run_one_test ".expand("%")." '".a:arg."'"
     exec "normal \<C-o>"
   endfunction
@@ -92,10 +92,10 @@ else
   " we have tmux and are not in control mode; we don't need to show any output in the Vim pane so life is simpler
   " assume the left-most window is for the shell
   noremap <Leader>t {:keeppatterns /^[^ #]<CR>:silent! call RunTestInFirstPane("<C-r><C-w>")<CR><C-o>
-  function RunTestInFirstPane(arg)
+  function! RunTestInFirstPane(arg)
     call RunInFirstPane("./run_one_test ".expand("%")." ".a:arg)
   endfunction
-  function RunInFirstPane(arg)
+  function! RunInFirstPane(arg)
     exec "!tmux select-pane -t :0.0"
     exec "!tmux send-keys '".a:arg."' C-m"
     exec "!tmux last-pane"