Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

AAD is basically an 8-bit immediate multiply-accumulate, so it could be said that the 8088 had a MAC instruction - with self-modifying code you could do a real 8-bit multiply-accumulate. ;-)

There's also this 5-byte sequence to convert a nybble (0-F) in AL into the appropriate ASCII hex digit (30h-39h, 41h-46h):

    cmp al, 10
    sbb al, 69h
    das
x86 code can be insanely dense - check out the 256-byte and below categories in the demoscene, for example.


That looks much cooler than the way I recently tried to print numbers in hex when teaching myself some more asm (https://gist.github.com/aktau/a85a925282fbe66d13b0). I wonder how it performs... (afaik, old rarely used instructions like that could get deprioritized by intel)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: