News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Exagone Tutorial question

Started by j00n, June 09, 2014, 10:24:06 AM

Previous topic - Next topic

j00n

mov eax, 12345678h mov loads a value into a register (note: 12345678h is a hex value because of the 'h' suffix)
mov cl, ah move the high byte of ax (67h) into cl (error here)
sub cl, 10 substract 10 (dec.) from the value in cl
mov al, cl and store it in the lowest byte of eax.

This was in the tutorial but looks like a typo, correct me if I'm wrong, isn't 56 = ah and 78 al and ax would be 5678h?

Thanks.

dedndave

12345678h
12 34 56 78

AH = 56h, initially, not 67h

    mov     eax,12345678h
    mov     cl,ah                          ;CL = 56h = 86 decimal
    sub     cl,10                          ;CL = 76 = 4Ch
    mov     al,cl                          ;EAX = 1234564Ch

j00n

So the tutorial had an error, thanks for the clarification.

I love this forum, just wish I had more time to read!

dedndave

well - someone had an error
Quotemov cl, ah move the high byte of ax (67h) into cl (error here)

they grabbed the 6th and 7th character by accident
it should be the 5th and 6th