Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GNU AS簡介
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Wen_Liao
June 28, 2015
Technology
0
1.2k
GNU AS簡介
Gnu AS簡介,歡迎debug
Wen_Liao
June 28, 2015
Tweet
Share
More Decks by Wen_Liao
See All by Wen_Liao
COSCUP-2020-Linux 軟體組裝工和他的工具們
wen_liao
2
1.5k
開放街圖 自助旅行的好幫手
wen_liao
0
1.3k
UPnP 1.0 簡介
wen_liao
0
1.1k
自由軟體和 Richard Stallman
wen_liao
0
2.3k
Hello world在那邊?背景說明 0
wen_liao
0
770
A successful Git branching model 導讀
wen_liao
0
690
GNU ld的linker script簡介
wen_liao
0
1.4k
Trace 程式碼之皮
wen_liao
0
910
淺談Debian套件打包
wen_liao
0
650
Other Decks in Technology
See All in Technology
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
190
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
430
AI駆動開発を事業のコアに置く
tasukuonizawa
1
220
Webhook best practices for rock solid and resilient deployments
glaforge
1
290
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
170
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
超初心者からでも大丈夫!オープンソース半導体の楽しみ方〜今こそ!オレオレチップをつくろう〜
keropiyo
0
110
SRE Enabling戦記 - 急成長する組織にSREを浸透させる戦いの歴史
markie1009
0
130
Tebiki Engineering Team Deck
tebiki
0
24k
Red Hat OpenStack Services on OpenShift
tamemiya
0
110
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
170
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
A designer walks into a library…
pauljervisheath
210
24k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
190
Statistics for Hackers
jakevdp
799
230k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
110
The untapped power of vector embeddings
frankvandijk
1
1.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Transcript
Wen Liao GNU AS 簡介 台南市,虎尾寮
Disclaimer 投影片資料為作者整理資料及個人意見,沒有經 過嚴謹確認,請讀者自行斟酌
目標 介紹GNU AS以及binutils的用法
測試環境:Guest OS
測試環境:Qemu
關於GNU AS • 簡稱gas,或是直接as • 組合語言是也 ◦ 把組合語言轉成binary的object file
gas原始碼組成 • Symbol ◦ label也是一個symbol • directive ◦ .開頭的字 ◦
有些通用,有些和CPU平台相關 • Expression • Instruction ◦ 最後會轉成機械碼的東西
今天不會提到的 • 巨集 • 條件式directive • 除錯相關directive • 硬體架構相關
還記得linker script嘛? • Sections ◦ .text ◦ .bss ◦ .data
◦ .rodata ◦ … • 進入點 • 這些全部要自行處理
還記得ABI嘛? • 一樣要自己處理 ◦ Call convention ◦ Frame pointer ◦
Call stack
在組合語言中一切自己來 • printf?沒這東西 • 開檔案?寫東西,請愛用system call
兩光的Hello World directives
兩光的Hello World section
兩光的Hello World symbol
兩光的Hello World system call r0 = write(1, hello_str, hello_len) exit(r0)
兩光的Hello World expression
上面是爛程式碼示範 • 好的程式碼示範 ( 感謝Scott Tasi大大)
回家作業:九九乘法表 • 檔案結構 ◦ Makefile ◦ main.S ◦ multi_table.S •
執行 • nm 觀察 • objdump 反組譯比對。看Symbol • gdb ◦ Hint ▪ --gstabs+ 參數