x86_64 machine code (linux), 175175 99 bytes
00000000004000b00000000000400080 <_start>:
4000b0400080: 41 bc 0109 00 00 00 mov $0x1$0x9,%r12d
00000000004000b60000000000400086 <_table.L2>:
4000b6400086: 416a bd0a 01 00 00 00 mov $0x1,%r13d
00000000004000bc <_table.L3>: pushq $0xa
4000bc400088: 4c4d 89 e8e5 mov %r13%r12,%rax%r13
000000000040008b 4000bf<_table.L3>:
40008b: 49 f7 e44c 89 e8 mul mov %r12
00000000004000c2 <_printInteger>: %r13,%rax
4000c240008e: 6a49 20f7 e4 mul pushq $0x20%r12
0000000000400091 <_printInteger>:
4000c4400091: 486a 3120 c9 xor pushq %rcx,%rcx$0x20
00000000004000c70000000000400093 <_printInteger.L1>:
4000c7400093: 48 31 d2 xor %rdx,%rdx
4000ca: 48 ff c1 inc %rcx
4000cd400096: 41 b8 0a 00 00 00 mov $0xa,%r8d
4000d340009c: 49 f7 f0 div %r8
4000d640009f: 48 83 c2 30 add $0x30,%rdx
4000da4000a3: 52 push %rdx
4000db4000a4: 48 85 c0 test %rax,%rax
4000de4000a7: 75 e7ea jne 4000c7400093 <_printInteger.L1>
4000e04000a9: 6a 3d pushq $0x3d
4000e24000ab: 49 83 c4 30 add $0x30,%r12
4000e64000af: 41 54 push %r12
4000e84000b1: 49 83 ec 30 sub $0x30,%r12
4000ec4000b5: 6a 78 pushq $0x78
4000ee4000b7: 49 83 c5 30 add $0x30,%r13
4000f24000bb: 41 55 push %r13
4000f44000bd: 49 83 ed 3031 sub $0x30$0x31,%r13
00000000004000f8 <_printChars>:
4000f8: 48 89 c8 mov %rcx,%rax
4000fb: 41 b8 08 00 00 00 mov $0x8,%r8d
400101: 49 f7 e0 mul %r8
400104: 48 83 c0 28 add $0x28,%rax
400108: 48 89 c2 mov %rax,%rdx
40010b: b8 01 00 00 00 mov $0x1,%eax
4001104000c1: bf 01 00 00 00 mov $0x1,%edi
400115: 4d 4885 8ded 34 24 lea test (%rsp)%r13,%rsi%r13
4001194000c4: 0f 05 syscall
75 c5 40011b: 48 83 c2 28 jne add 40008b $0x28,%rdx<_table.L3>
40011f4000c6: 48 01 d4 add %rdx,%rsp
400122: 49 ff 49cc 83 c5 01 adddec $0x1,%r13%r12
4001264000c9: 4d 39 e585 e4 cmp test %r12,%r13%r12
4001294000cc: 7e75 91b8 jlejne 4000bc400086 <_table.L3>L2>
000000000040012b00000000004000ce <_printNewline><_printChars>:
40012b4000ce: b8ba 01b8 0009 00 00 mov $0x1$0x9b8,%eax%edx
4001304000d3: bfb8 01 00 00 00 mov $0x1,%edi%eax
4001354000d8: babf 01 00 00 00 mov $0x1,%edx
40013a: 48 be 60 01 60 00 00 movabs $0x600160,%rsi
400141: 00 00 00
400144: 0f 05 syscall
400146: 49 83 c4 01 add $0x1,%r12
40014a: 49 83 fc 0a cmp $0xa,%r12
40014e: 0f 85 62 ff ff ff jne 4000b6 <_table.L2>
0000000000400154 <_exit>:
400154: b8 3c 00 00 00 mov $0x3c,%eax%edi
4001594000dd: 48 31 ff 8d 34 24 xorlea %rdi(%rsp),%rdi%rsi
40015c4000e1: 0f 05 syscall
Disassembly of section .data:
0000000000600160 <newline>:
600160: 0a .byte 0xa
This is a dump of the binary file, and all ofThis is a dump of the binary file, and all of this is 175 bytes. It basically does the same two loops that all the answers do, but printing to the console is a bit harder and basically requires pushing the characters to print onto the stack in reverse, and then making a (linux specific) syscall to actually put those chars into stdout.
I've now optimized this is 175 bytes. It basically does the same two loopsso that all the answers do, but printing to the consoleonly 1 write operation is a bit harderperformed (faster!) and basically requireshas magic numbers (wow!) and by pushing the characters to printentire result onto the stack in reverse, and thenbackwards before making a (linux specific)the syscall to actually put those chars into stdout. I also took out the exit routine because who needs proper exit code?
ThisHonestly a few bytes could probably be "legally" removed because code golf doesn't require full programs, only snippets, so a few of the values could be "assumed" to be initialized such as the first mov instruction into r12, but unless someone can definitelycome up with a close competing result in x86_64 machine code, I'll leave it be golfed down.
Here's a bit morelink to my first and second attempts, in their original nasm syntax.
(Also, it doesn't print the extra spaces to make all the columns aligned, but this isif that's required I can put the first attemptlogic in at the cost of a few more bytes).
I welcome anyonewhoanyone who has any other suggestions on how it can be improved. I can also explain the logic in more detail if anyone is curious.