$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
87
読みやすいアセンブリ言語
第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
390
「行ってよかった!」をみんなに広げる
cybozuinsideout
PRO
0
130
不具合の先にある面白さ~配属3か月目の新卒QAのいま~
cybozuinsideout
PRO
0
360
kintone開発チームの紹介
cybozuinsideout
PRO
1
82k
kintone開発のプラットフォームエンジニアの紹介
cybozuinsideout
PRO
0
340
AIツール開発ワークショップ(Dify)【サイボウズ新人研修2025】
cybozuinsideout
PRO
22
25k
モバイル【サイボウズ新人研修2025】
cybozuinsideout
PRO
3
4.4k
Git/GitHub を使う上で知っておくと嬉しいかも Tips【サイボウズ新人研修2025】
cybozuinsideout
PRO
16
11k
GitHub Copilot活用【サイボウズ新人研修2025】
cybozuinsideout
PRO
15
16k
Other Decks in Technology
See All in Technology
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
1
700
今年のデータ・ML系アップデートと気になるアプデのご紹介
nayuts
1
250
新 Security HubがついにGA!仕組みや料金を深堀り #AWSreInvent #regrowth / AWS Security Hub Advanced GA
masahirokawahara
1
1.7k
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
2.7k
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
270
AWSを使う上で最低限知っておきたいセキュリティ研修を社内で実施した話 ~みんなでやるセキュリティ~
maimyyym
2
260
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
今からでも間に合う!速習Devin入門とその活用方法
ismk
1
630
AWS Trainium3 をちょっと身近に感じたい
bigmuramura
1
140
法人支出管理領域におけるソフトウェアアーキテクチャに基づいたテスト戦略の実践
ogugu9
1
220
世界最速級 memcached 互換サーバー作った
yasukata
0
330
[CMU-DB-2025FALL] Apache Fluss - A Streaming Storage for Real-Time Lakehouse
jark
0
110
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
1
96
A designer walks into a library…
pauljervisheath
210
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
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コンパイラを実装できるようにしたい ・機械語の出力 ・型の勉強
まとめ・感想 ・「読みやすさ」は、観点による ・「読みやすさ」だけではないので、そこも考えていきたい ・川合さんをはじめ、サポートしていただいた方々、 本当にありがとうございました!
ありがとうございました