日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

linux下汇编实例

發布時間:2025/3/20 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux下汇编实例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

代碼:

$ cat hello.s .text .global _startmsg: .ascii "Hello World!\n" msg_end: .equ len, msg_end - msg .equ SYS_write, 1 .equ SYS_exit, 60_start: mov $SYS_write, %rax # system call number (sys_write) mov $1, %rdi # file descriptor (stdout) mov $msg, %rsi # message to write mov $len, %rdx # message length. syscall # previous 'int $0x80' in i386mov $SYS_exit, %rax # system call number (sys_exit) mov $0, %rdi # exit (0) syscall # previous 'int $0x80' in i386

運行:

$ as -o hello.o hello.s $ ld -o hello hello.o $ ./hello Hello World!

反匯編:

$ objdump --disassemble-all hellohello: 文件格式 elf64-x86-64Disassembly of section .text:0000000000400078 <msg>:400078: 48 rex.W400079: 65 6c gs insb (%dx),%es:(%rdi)40007b: 6c insb (%dx),%es:(%rdi)40007c: 6f outsl %ds:(%rsi),(%dx)40007d: 20 57 6f and %dl,0x6f(%rdi)400080: 72 6c jb 4000ee <_start+0x69>400082: 64 21 0a and %ecx,%fs:(%rdx)0000000000400085 <_start>:400085: 48 c7 c0 01 00 00 00 mov $0x1,%rax40008c: 48 c7 c7 01 00 00 00 mov $0x1,%rdi400093: 48 c7 c6 78 00 40 00 mov $0x400078,%rsi40009a: 48 c7 c2 0d 00 00 00 mov $0xd,%rdx4000a1: 0f 05 syscall 4000a3: 48 c7 c0 3c 00 00 00 mov $0x3c,%rax4000aa: 48 c7 c7 00 00 00 00 mov $0x0,%rdi4000b1: 0f 05 syscall $ od -x hello 0000000 457f 464c 0102 0001 0000 0000 0000 0000 0000020 0002 003e 0001 0000 0085 0040 0000 0000 0000040 0040 0000 0000 0000 0238 0000 0000 0000 0000060 0000 0000 0040 0038 0001 0040 0005 0002 0000100 0001 0000 0005 0000 0000 0000 0000 0000 0000120 0000 0040 0000 0000 0000 0040 0000 0000 0000140 00b3 0000 0000 0000 00b3 0000 0000 0000 0000160 0000 0020 0000 0000 6548 6c6c 206f 6f57 0000200 6c72 2164 480a c0c7 0001 0000 c748 01c7 0000220 0000 4800 c6c7 0078 0040 c748 0dc2 0000 0000240 0f00 4805 c0c7 003c 0000 c748 00c7 0000 0000260 0f00 0005 0000 0000 0000 0000 0000 0000 0000300 0000 0000 0000 0000 0000 0000 0000 0000 0000320 0000 0000 0003 0001 0078 0040 0000 0000 0000340 0000 0000 0000 0000 0001 0000 0004 fff1 0000360 0000 0000 0000 0000 0000 0000 0000 0000 0000400 0009 0000 0000 0001 0078 0040 0000 0000 0000420 0000 0000 0000 0000 000d 0000 0000 0001 0000440 0085 0040 0000 0000 0000 0000 0000 0000 0000460 0015 0000 0000 fff1 000d 0000 0000 0000 0000500 0000 0000 0000 0000 0019 0000 0000 fff1 0000520 0001 0000 0000 0000 0000 0000 0000 0000 0000540 0023 0000 0000 fff1 003c 0000 0000 0000 0000560 0000 0000 0000 0000 0031 0000 0010 0001 0000600 0085 0040 0000 0000 0000 0000 0000 0000 0000620 002c 0000 0010 0001 00b3 0060 0000 0000 0000640 0000 0000 0000 0000 0038 0000 0010 0001 0000660 00b3 0060 0000 0000 0000 0000 0000 0000 0000700 0010 0000 0010 0001 00b8 0060 0000 0000 0000720 0000 0000 0000 0000 6800 6c65 6f6c 6f2e 0000740 6d00 6773 6d00 6773 655f 646e 6c00 6e65 0000760 5300 5359 775f 6972 6574 5300 5359 655f 0001000 6978 0074 5f5f 7362 5f73 7473 7261 0074 0001020 655f 6164 6174 0000 732e 6d79 6174 0062 0001040 732e 7274 6174 0062 732e 7368 7274 6174 0001060 0062 742e 7865 0074 0000 0000 0000 0000 0001100 0000 0000 0000 0000 0000 0000 0000 0000 * 0001160 0000 0000 0000 0000 001b 0000 0001 0000 0001200 0006 0000 0000 0000 0078 0040 0000 0000 0001220 0078 0000 0000 0000 003b 0000 0000 0000 0001240 0000 0000 0000 0000 0001 0000 0000 0000 0001260 0000 0000 0000 0000 0011 0000 0003 0000 0001300 0000 0000 0000 0000 0000 0000 0000 0000 0001320 0217 0000 0000 0000 0021 0000 0000 0000 0001340 0000 0000 0000 0000 0001 0000 0000 0000 0001360 0000 0000 0000 0000 0001 0000 0002 0000 0001400 0000 0000 0000 0000 0000 0000 0000 0000 0001420 00b8 0000 0000 0000 0120 0000 0000 0000 0001440 0004 0000 0008 0000 0008 0000 0000 0000 0001460 0018 0000 0000 0000 0009 0000 0003 0000 0001500 0000 0000 0000 0000 0000 0000 0000 0000 0001520 01d8 0000 0000 0000 003f 0000 0000 0000 0001540 0000 0000 0000 0000 0001 0000 0000 0000 0001560 0000 0000 0000 0000 0001570

?

轉載于:https://my.oschina.net/u/2245781/blog/913931

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的linux下汇编实例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。