title: How do "case tables" work in NASM?
body: <p>As part of our assignment we are supposed to do various functions with matrices. For the menu, we are assigned to use a "case table" (which is implemented as a 2-D array with each row containing only a letter constant and its corresponding function) </p>
  
  <p>I really cannot make sense of the notes, and the book is zero help (it doesn't mention them at all) </p>
  
  <pre><code>    .data
  CaseTable BYTE 'A'  ; lookup value
      DWORD Process_A ; address of procedure
      EntrySize = ($ - CaseTable)
      BYTE 'B'
      DWORD Process_B
      BYTE 'C'
      DWORD Process_C
      BYTE 'D'
      DWORD Process_D
  
  NumberOfEntries = ($ - CaseTable) / EntrySize
  ….
  segment .text
  ...
      mov ebx, CaseTable  ; point EBX to the table
      mov ecx,NumberOfEntries ; loop counter
  
  L1: cmp al,[ebx]    ; match found?
      jne L2  ; no: continue
      call PTR [ebx + 1]  ; yes: call the procedure
      jmp L3  ; and exit the loop
  L2: add ebx,EntrySize   ; point to next entry
      loop L1 ; repeat until ECX = 0
  
  L3:
  </code></pre>
  
  <p>Can someone help me make sense of this?</p>