Page 1 of 1

"PUSHA" becomes "DB 60"???

Posted: Mon May 16, 2011 8:44 pm
by nicola
this is my code:

Code: Select all

                use16
                jmp start

;print byte in AL=============================================================
print_byte:     pusha
                push ax         ;save AL

                and al,0f0h     ;get high nibble
                mov cl,4
                shr al,cl
                mov bl,48
                cmp al,0ah
                jl print_hi_nib
                mov bl,55

print_hi_nib:   add al,bl
                mov ah,0eh
                xor bh,bh
                int 10h

                pop ax          ;get back AL
                and al,0fh      ;get low nibble
                mov bl,48
                cmp al,0ah
                jl print_lo_nib
                mov bl,55

print_lo_nib:   add al,bl
                mov ah,0eh
                xor bh,bh
                int 10h

                popa
                ret...................................... 
flat assembler gave me a strange .bin file, my "PUSHA" had become "DB 60".
anybody knows why?

Re: "PUSHA" becomes "DB 60"???

Posted: Mon May 16, 2011 11:54 pm
by eddyb

Code: Select all

eddy@eddy-laptop:~> rasm2 -d 60
pushad
eddy@eddy-laptop:~> rasm2 pusha
60
Did I miss anything? Is that DB there a 0xdb or the DB directive in assemblers?
PS: That rasm2 there comes from radare (http://radare.nopcode.org/y/) - which could be very valuable for inspecting binary files (in radare itself you can scroll trough the assembly) ;).

Re: "PUSHA" becomes "DB 60"???

Posted: Tue May 17, 2011 12:02 am
by nicola
so much a great tool, tkx for the suggestion :)
i finally find out why, the code runs ok, but the thing shown in debug.exe is 'db 60'
what a fun, but interesting, debug.exe doesnt recognise .486 instructions.
seems to be

Re: "PUSHA" becomes "DB 60"???

Posted: Tue May 17, 2011 12:11 am
by xenos
The opcode for pusha is 0x60. Have a look at the Intel Manuals, Volume 2B, "PUSHA".