"PUSHA" becomes "DB 60"???

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
nicola
Member
Member
Posts: 32
Joined: Mon May 16, 2011 2:05 pm
Location: hanoi

"PUSHA" becomes "DB 60"???

Post 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?
I'm using AMD Sempron 140 Single core 2.7GHz
eddyb
Member
Member
Posts: 248
Joined: Fri Aug 01, 2008 7:52 am

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

Post 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) ;).
User avatar
nicola
Member
Member
Posts: 32
Joined: Mon May 16, 2011 2:05 pm
Location: hanoi

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

Post 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
I'm using AMD Sempron 140 Single core 2.7GHz
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

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

Post by xenos »

The opcode for pusha is 0x60. Have a look at the Intel Manuals, Volume 2B, "PUSHA".
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
Post Reply