IRC channel logs

2020-08-27.log

back to list of logs

<OriansJ`>bauen1: nice. although you could skip the add rax, 10 if you replace the sub rax, 'A' - '0' with sub rax, 7; then the cmp rax, 5 would become cmp rax, 15
<OriansJ`>bauen1: wrote a little program to help spot potentially bad input https://paste.debian.net/1161388/
<OriansJ`>and just nasm -felf64 hex0.s -o bin/hex0.o && ld bin/hex0.o -o bin/hex0 && ./bin/hex0 | grep -av FFFFFFFFFFFFFFFF
<OriansJ`>and I got the hex function down to 34bytes with: https://paste.debian.net/1161389/
<OriansJ`>which is a small savings I guess from your 49byte hex function
<OriansJ`>there is a stupid trick using loop which could shave off a couple extra bytes in hex but I don't see a benefit to making it harder to reason about
<OriansJ`>as doing dec, inc, sub and add all set the same flags as a comparison in AMD64/x86 making for crazy combos like add al, 7 jbe foo sort of fun
<bauen1>OriansJ`: yeah, you could do some serious code golf on the hex0, but apart from situation where it either reduces the size of "logic" or the number of relative references or the number of distinct opcodes used i don't really see a point in doing that
***terpri__ is now known as terrpi