# Read numbers from input and print them
31 ED           # ebp = 0               xor r/m32, r32      31 /r           11 101 101
31 FF           # edi = 0 (lenArr)      xor r/m32, r32      31 /r           11 111 111
E9 800-         # jump WORD             jmp rel32           E9 cd

200: # Show     #
31 DB           # ebx = 0 (index)       xor r/m32, r32      31 /r           11 011 011
E9 300-         # jump .number          jmp rel32           E9 cd

300: # .number  #
3B DF           # cmp ebx, edi          cmp r32, r/m32      3B /r           11 011 111
7C 01           # jump +1 if <          jl rel8             7C cb
C3              # return                ret                 C3
8B 04 9D B04+   # eax = [4*ebx+Arr]     mov r32, r/m32      8B /r   00 000 100  10 011 101
# .space:
B9 EE00+        # ecx = nbuf-1          mov r32, imm32      B8+rd id
C6 01 20        # [ecx] = ' '           mov r/m8, imm8      C6 /0 ib        00 000 001
E9 500-         # jump .numeral         jmp rel32           E9 cd

500: # .numeral # div r/m32: Unsigned divide EDX:EAX by r/m32 -- EAX=quot EDX=rem
31 D2           # edx = 0               xor r/m32, r32      31 /r           11 010 010
F7 35 B00+      # divide by base        div r/m32           F7 /6           00 110 101
8A 92 A00+      # dl = [edx+Ascii]      mov r8, r/m8        8A /r           10 010 010
49 88 11        # [--ecx] = dl          dec; mov r/m8, r8   88 /r           00 010 001
85 C0           # cmp eax, 0            test r/m32, r32     85 /r           11 000 000
0F 85 500-      # jump .numeral if !=   jne rel32           0F 85 cd
# .write:
BA EE01+        # edx = nbuf            mov r32, imm32      B8+rd
29 CA           # edx -= ecx            sub r/m32, r32      29 /r           11 001 010
53              # push ebx              push r32            50+rd       S: index
E8 54-          # call PutOut           call rel32          E8 cd
0F 8C 7F-       # jump Exit+1 if <      jl rel32            0F 8C cd
5B              # pop ebx               pop r32             58+rd       S:
43              # ebx++                 inc r32             40+rd
E9 300-         # jump .number          jmp rel32           E9 cd

A00: 30 31 32 33 34 35 36 37 38 39      41 42 43 44 45 46           # numeral to Ascii
A30: 0 1 2 3 4 5 6 7 8 9    A41: A B C D E F    A61: A B C D E F    # Ascii to numeral

B00: 10         # base
B04:            # Arr

800: # WORD     #
BB 00 00 00 80  # ebx = null (acc)      mov r32, imm32      B8+rd id
E9 900-         # jump CHAR             jmp rel32           E9 cd

900: # CHAR     #
B9 FF00+        # ecx = ibuf            mov r32, imm32      B8+rd id
BA 00 01 00 00  # edx = count           mov r32, imm32      B8+rd id
53              # push ebx              push r32            50+rd       S: acc
E8 67-          # call TakeIn           call rel32          E8 cd
0F 8C 7F-       # jump Exit+1 if <      jl rel32            0F 8C cd
0F 8E 7A-       # jump Exit if <=       jle rel32           0F 8E cd
5B              # pop ebx               pop r32             58+rd       S:
31 C0           # eax = 0               xor r/m32, r32      31 /r           11 000 000
8A 06           # al = [esi]            mov r8, r/m8        8A /r           00 000 110
8A 80 C00+      # al = [eax+Char>Act]   mov r8, r/m8        8A /r           10 000 000
FF A0 D00+      # jump [eax+Act>Doer]   jmp r/m32           FF /4           10 100 000

# C00: Char>Act D00: Act>Doer
                D00: E00+   #           numeral
C09: 04                     # TAB       whSpace
C0A: 04                     # LF        whSpace
C20: 04         D04: E20+   # SPACE     whSpace

E00: # Do numeral
31 C0           # eax = 0               xor r/m32, r32      31 /r           11 000 000
8A 06           # al = [esi]            mov r8, r/m8        8A /r           00 000 110
8A 80 A00+      # al = [eax+Ascii]      mov r8, r/m8        8A /r           10 000 000
0F AF 1D B00+   # ebx *= base           imul r32, r/m32     0F AF /r        00 011 101
01 C3           # ebx += eax            add r/m32, r32      01 /r           11 000 011
E9 900-         # jump CHAR             jmp rel32           E9 cd

E20: # Do whSpace
85 DB           # cmp ebx, 0            test r/m32, r32     85 /r           11 011 011
0F 8C E40-      # jump .show if <       jl rel32            0F 8C cd
89 1C BD B04+   # [4*edi+Arr] = ebx     mov r/m32, r32      89 /r   00 011 100  10 111 101
47              # edi++                 inc r32             40+rd
E9 E40-         # jump .show            jmp rel32           E9 cd

E40: # .show:   # (if end of line)
80 3E 0A        # cmp [esi], '\n'       cmp r/m8, imm8      80 /7 ib        00 111 110
0F 85 800-      # jump WORD if !=       jne rel32           0F 85 cd
E8 200-         # call Show             call rel32          E8 cd
E9 800-         # jump WORD             jmp rel32           E9 cd