dis [-f] [-w outfile] [-F funcname]|addr[count|[bcount acount]]
Display the disassembled code for addr for count instructions (the default count is 1). Alternately, display the disassembled code for addr with bcount instructions before and acount instructions after. If bcount or acount is zero, then no instructions will be displayed before or after respectively. If the dis command is issued with the -f command line option, additional information will be displayed (opcode and byte size). If the dis command is issued with the -F option followed by funcname, disassembled code will be displayed for all instructions in the function.
Example 4-3. dis (i386)
>> dis -F memcmp 0xc0251878 <memcmp>: pushl %esi 0xc0251879 <memcmp+1>: pushl %ebx 0xc025187a <memcmp+2>: movb $0x0,%al 0xc025187c <memcmp+4>: movl 0x14(%esp,1),%esi 0xc0251880 <memcmp+8>: movl 0xc(%esp,1),%ecx 0xc0251884 <memcmp+12>: movl 0x10(%esp,1),%edx 0xc0251888 <memcmp+16>: testl %esi,%esi 0xc025188a <memcmp+18>: je 0xc02518a1 <memcmp+41> 0xc025188c <memcmp+20>: jmp 0xc0251895 <memcmp+29> 0xc025188e <memcmp+22>: movl %esi,%esi 0xc0251890 <memcmp+24>: incl %ecx 0xc0251891 <memcmp+25>: incl %edx 0xc0251892 <memcmp+26>: decl %esi 0xc0251893 <memcmp+27>: je 0xc02518a1 <memcmp+41> 0xc0251895 <memcmp+29>: movb (%edx),%al 0xc0251897 <memcmp+31>: movb (%ecx),%bl 0xc0251899 <memcmp+33>: subb %al,%bl 0xc025189b <memcmp+35>: movb %bl,%al 0xc025189d <memcmp+37>: testb %al,%al 0xc025189f <memcmp+39>: je 0xc0251890 <memcmp+24> 0xc02518a1 <memcmp+41>: movsbl %al,%eax 0xc02518a4 <memcmp+44>: popl %ebx 0xc02518a5 <memcmp+45>: popl %esi 0xc02518a6 <memcmp+46>: ret 0xc02518a7 <memcmp+47>: nop >> dis 0xc025188e 10 -f 0xc025188e <memcmp+22>: 0x0089 movl %esi,%esi (2 bytes) 0xc0251890 <memcmp+24>: 0x0041 incl %ecx (1 byte) 0xc0251891 <memcmp+25>: 0x0042 incl %edx (1 byte) 0xc0251892 <memcmp+26>: 0x004e decl %esi (1 byte) 0xc0251893 <memcmp+27>: 0x0074 je 0xc02518a1 <memcmp+41> (2 bytes) 0xc0251895 <memcmp+29>: 0x008a movb (%edx),%al (2 bytes) 0xc0251897 <memcmp+31>: 0x008a movb (%ecx),%bl (2 bytes) 0xc0251899 <memcmp+33>: 0x0028 subb %al,%bl (2 bytes) 0xc025189b <memcmp+35>: 0x0088 movb %bl,%al (2 bytes) 0xc025189d <memcmp+37>: 0x0084 testb %al,%al (2 bytes)
Example 4-4. dis (s390)
>> idis 00154d8c 19 0x154d8c <memcmp>: lhi %r0,0 0x154d90 <memcmp+4>: lr %r5,%r2 0x154d92 <memcmp+6>: j 0x154da2 <memcmp+22> 0x154d96 <memcmp+10>: ahi %r5,1 0x154d9a <memcmp+14>: ahi %r3,1 0x154d9e <memcmp+18>: ahi %r4,-1 0x154da2 <memcmp+22>: ltr %r4,%r4 0x154da4 <memcmp+24>: je 0x154dc0 <memcmp+52> 0x154da8 <memcmp+28>: ic %r0,0(%r5) 0x154dac <memcmp+32>: ic %r1,0(%r3) 0x154db0 <memcmp+36>: sr %r0,%r1 0x154db2 <memcmp+38>: lr %r2,%r0 0x154db4 <memcmp+40>: sll %r2,24 0x154db8 <memcmp+44>: sra %r2,24 0x154dbc <memcmp+48>: je 0x154d96 <memcmp+10> 0x154dc0 <memcmp+52>: lr %r2,%r0 0x154dc2 <memcmp+54>: sll %r2,24 0x154dc6 <memcmp+58>: sra %r2,24 0x154dca <memcmp+62>: br %r14