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
読みやすいアセンブリ言語
Search
Cybozu
PRO
March 14, 2025
Technology
1
36
読みやすいアセンブリ言語
第14期サイボウズ・ラボユース成果発表会
https://cybozu.connpass.com/event/347931/
川崎 正真
Cybozu
PRO
March 14, 2025
Tweet
Share
More Decks by Cybozu
See All by Cybozu
PSIRTでAIテストを実施するまでの道のり
cybozuinsideout
PRO
0
85
無理なく続けるサイボウズの社内勉強会
cybozuinsideout
PRO
1
1.2k
分散システムにおける 無兆候データ破損の影響について
cybozuinsideout
PRO
1
57
タンパク質構造のシミュレーションソフトウェア試行錯誤
cybozuinsideout
PRO
1
45
Wasmで拡張できる軽量マークアップ⾔語Brack(後編)
cybozuinsideout
PRO
1
30
Wasmで拡張できる軽量マークアップ⾔語Brack(前編)
cybozuinsideout
PRO
1
33
kintone開発組織のAWSエンジニアの紹介
cybozuinsideout
PRO
0
220
kintone開発組織のサービスプラットフォームチームの紹介
cybozuinsideout
PRO
0
120
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
6
41k
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
1.8k
Tenstorrent 開発者プログラム
tenstorrent_japan
0
290
Agent Development Kit によるエージェント開発入門
enakai00
19
2.9k
Long journey of Continuous Delivery at Mercari
hisaharu
1
200
堅牢な認証基盤の実現 TypeScriptで代数的データ型を活用する
kakehashi
PRO
1
190
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #開発生産性_findy
takabow
1
350
Introduction to Bill One Development Engineer
sansan33
PRO
0
250
産業機械をElixirで制御する
kikuyuta
0
140
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
2.1k
Devin(Deep) Wiki/Searchの活用で変わる開発の世界観/devin-wiki-search-impact
tomoki10
0
220
Monorepo Error Management: Automated Runbooks and Team-Targeted Alert Distribution
biwashi
1
150
dbt Cloudの新機能を紹介!データエンジニアリングの民主化:GUIで操作、SQLで管理する新時代のdbt Cloud
sagara
0
180
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
35
2.3k
Git: the NoSQL Database
bkeepers
PRO
430
65k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
How GitHub (no longer) Works
holman
314
140k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
It's Worth the Effort
3n
184
28k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
680
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コンパイラを実装できるようにしたい ・機械語の出力 ・型の勉強
まとめ・感想 ・「読みやすさ」は、観点による ・「読みやすさ」だけではないので、そこも考えていきたい ・川合さんをはじめ、サポートしていただいた方々、 本当にありがとうございました!
ありがとうございました
Otomatik - 172.67.23.78
CloudFlare DNS
Türk Telekom DNS
Google DNS
Open DNS
OSZAR »