$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
読みやすいアセンブリ言語
Search
Cybozu
PRO
March 14, 2025
Technology
1
84
読みやすいアセンブリ言語
第14期サイボウズ・ラボユース成果発表会
https://cybozu.connpass.com/event/347931/
川崎 正真
Cybozu
PRO
March 14, 2025
Tweet
Share
More Decks by Cybozu
See All by Cybozu
つけまが降ってきた日
cybozuinsideout
PRO
1
370
「行ってよかった!」をみんなに広げる
cybozuinsideout
PRO
0
130
不具合の先にある面白さ~配属3か月目の新卒QAのいま~
cybozuinsideout
PRO
0
330
kintone開発チームの紹介
cybozuinsideout
PRO
1
81k
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
0
310
AIツール開発ワークショップ(Dify)【サイボウズ新人研修2025】
cybozuinsideout
PRO
21
25k
モバイル【サイボウズ新人研修2025】
cybozuinsideout
PRO
3
4.4k
Git/GitHub を使う上で知っておくと嬉しいかも Tips【サイボウズ新人研修2025】
cybozuinsideout
PRO
15
11k
GitHub Copilot活用【サイボウズ新人研修2025】
cybozuinsideout
PRO
15
16k
Other Decks in Technology
See All in Technology
翻訳・対話・越境で強いチームワークを作ろう! / Building Strong Teamwork through Interpretation, Dialogue, and Border-Crossing
ar_tama
4
1.6k
「え?!それ今ではHTMLだけでできるの!?」驚きの進化を遂げたモダンHTML
riyaamemiya
9
4.4k
タグ付きユニオン型を便利に使うテクニックとその注意点
uhyo
2
540
原理から解き明かす AIと人間の成長 - Progate BAR
teba_eleven
2
290
Bakuraku Engineering Team Deck
layerx
PRO
11
5.4k
研究開発部メンバーの働き⽅ / Sansan R&D Profile
sansan33
PRO
3
21k
MySQL AIとMySQL Studioを使ってみよう
ikomachi226
0
140
Design System Documentation Tooling 2025
takanorip
1
910
pmconf2025 - 他社事例を"自社仕様化"する技術_iRAFT法
daichi_yamashita
0
410
freeeにおけるファンクションを超えた一気通貫でのAI活用
jaxx2104
3
570
Multimodal AI Driving Solutions to Societal Challenges
keio_smilab
PRO
1
110
MAP-7thplaceSolution
yukichi0403
2
240
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Facilitating Awesome Meetings
lara
57
6.7k
Become a Pro
speakerdeck
PRO
30
5.7k
Faster Mobile Websites
deanohume
310
31k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
370
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
It's Worth the Effort
3n
187
29k
Transcript
読みやすいアセンブリ言語 14期ラボユース生 (言語処理系開発コース、メンター:川合さん) 川崎正真
概要 ・作品:sentasm、mnasm(仮) ・目的:読みやすいアセンブリ言語の作成 ・動機:自作cコンパイラのデバッグが大変だった ・開発の途中目標: 自作cコンパイラ(開発途中)で出力して、アセンブルできる
なぜ、デバッグが大変だったか ・スタックマシン方式だった ・アセンブリ言語に慣れてい無かった 1) 命令に慣れていなかった 2) 読み方に慣れていなかった
アセンブリ言語1 ・名前:sentasm(sentence + asm) ・開発期間:24年6月ー11月 ・特徴:英語に寄せた文法
アセンブリ言語1 ・fizzbuzzのcコードを コンパイルした結果の一部 gasだと、movsxd
アセンブリ言語1 ・読みづらい 1) 実際の命令との対応を覚えるのが大変 2) コードブロック単位の意味の把握が大変 ・全ての命令に前置詞などを意味を考えて、当てはめるのは困難
アセンブリ言語2 ・名前:mnasm(仮)(名前募集中です) ・現在開発中 ・特徴:ブロック、2種類のマクロ
アセンブリ言語2 ・fizzbuzzのcコードを コンパイルした結果の一部
アセンブリ言語2 ・マクロ1 ・cのdefineマクロと同様のもの ・呼び出し:@label{...}(...) ・マクロ2 ・rustのproc_macroのドメイン特化言語(DSL)版のようなもの ・DSL をアセンブル時に評価して、入力を加工し、展開 ・呼び出し:@[input]
アセンブリ言語2 マクロ定義の部分は 140行
アセンブリ言語2 ・ブロックの導入で比較的読みやすくなった ・マクロの定義の部分が大きくなる
比較 gas sentasm mnasm
今後 ・DSLの強化 ・自作cコンパイラにmnasmのインラインアセンブリの追加 ・自作cコンパイラのセルフホスト ・mnasmのDSLをsentasmや簡易cコンパイラを実装できるようにしたい ・機械語の出力 ・型の勉強
まとめ・感想 ・「読みやすさ」は、観点による ・「読みやすさ」だけではないので、そこも考えていきたい ・川合さんをはじめ、サポートしていただいた方々、 本当にありがとうございました!
ありがとうございました