This week’s puzzle is to copyÂ the carry flag to the high bit of ah.Â You may destroy any other register,Â the flags, and the other 24 bits of eax.Â Shortest sequence wins.
In Win32, there is an API call called “MulDiv”:
In C, the ! (“logical NOT”) operator used on a value x evaluates to 0 when x is not 0, and 1 when x is 0. In other words, it’s equivalent to the following C:
This puzzle is actually a quite easy one – but when I asked it in a university course, it kept some people busy for some time to find out the answer, so I thought it might be a good idea to ask you nevertheless:
This is our first assembly language puzzle for the new site! These puzzles are tests to seeÂ whether you are good enough of an assembly nerd, and to learn some tricks if you’re not =^_^=