本帖最后由 bitravel 于 2019-9-20 09:32 编辑
我们用反汇编工具来看一下这串二进制代码的意思,参考文章:https://blog.csdn.net/m0_37329910/article/details/93379045,https://stackoverflow.com/questions/10362630/how-can-objdump-emit-intel-syntax
使用objdump工具:objdump -m i8086 -M intel -b binary -D boot.img
显示结果:boot.img: file format binary
Disassembly of section .data:
00000000 <.data>:
//注:机器码开始
0: b8 00 b8 mov ax,0xb800
3: 8e c0 mov es,ax
5: b9 d0 07 mov cx,0x7d0
8: bb 00 00 mov bx,0x0
b: 26 c7 07 20 07 mov WORD PTR es:[bx],0x720
10: 81 c3 02 00 add bx,0x2
14: e2 f5 loop 0xb
16: b8 c0 07 mov ax,0x7c0
19: 8e d8 mov ds,ax
1b: fc cld
1c: be 2a 00 mov si,0x2a
1f: bf 00 00 mov di,0x0
22: b9 0c 00 mov cx,0xc
25: f3 a5 rep movs WORD PTR es:[di],WORD PTR ds:[si]
27: e9 fd ff jmp 0x27
//注:机器码结束
//写入文本模式的显存中的数据开始
2a: 48 dec ax
2b: 8f (bad)
2c: 65 8f gs (bad)
2e: 6c ins BYTE PTR es:[di],dx
2f: 8f (bad)
30: 6c ins BYTE PTR es:[di],dx
31: 8f (bad)
32: 6f outs dx,WORD PTR ds:[si]
33: 8f (bad)
34: 20 07 and BYTE PTR [bx],al
36: 57 push di
37: 02 6f 02 add ch,BYTE PTR [bx+0x2]
3a: 72 02 jb 0x3e
3c: 6c ins BYTE PTR es:[di],dx
3d: 02 64 02 add ah,BYTE PTR [si+0x2]
40: 21 02 and WORD PTR [bp+si],ax
//写入文本模式的显存中的数据结束
//...省略号中的内容全部为0
...
//0xaa55标识
1fe: 55 push bp
1ff: aa stos BYTE PTR es:[di],al
|