Riddle #1

Here is a little riddle for you… no more then 30 seconds to answer 🙂

 mov ecx, 0Ch
 mov dl, 1h
 mov dh, 1h
  xchg dh, dl
  add dl, dh
  movzx eax, dl
  loop L

Try to figure out what the code above is intended for, and let me know…

Enjoy 😉

p.s. Are you thinking about a bug? Well, it’s not a bug.


5 Responses to “Riddle #1”

  1. 1 rastaganga December 8, 2009 at 11:23 am

    The pseudo code:

      a = 1
      b = 1
      for(i = 12; i--; i==1) {
        b = a
        a = b + a

    I’m not sure what the code is ‘intended for’. For me it just looks like a weird loop 🙂

  2. 2 ratsoul December 9, 2009 at 11:19 am

    Hi rastaganga,

    thank you for your answer. I will say more about this riddle in the following days, now may be someone else want to play with it, so I don’t want to spoil 😉

  3. 3 dreyercito December 9, 2009 at 4:28 pm

    Seems a fibonacci sequence calculator. Fibonacci(ecx) (for iterations of n>1). Am I right? Do I get a lollipop?

  4. 4 ratsoul December 9, 2009 at 5:21 pm

    Hi dreyercito,

    your answer hit the solution but it is not 100% right. You are missing something…

    So no lollipop for you dude 😉

Comments are currently closed.


%d bloggers like this: