0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

アセンブラをコンパイルした結果がおかしくなる

Last updated at Posted at 2025-10-21

はじめに

タイトルの通りです。

問題のアセンブラコード

.section "test","ax"   >   0x44000
    nop
.align  0x8000

hexにして、逆アセンブルすると、0x44000番地に命令が置かれていてほしい!
が...

0x00048000 nop

0x48000番地に命令が置かれています。

原因

原因は、.align 0x8000です。
.alignはバイト境界を揃える記述です。
0x44000から0x48000にバイト境界を揃えたため、0x48000番地に命令が格納されています。

まとめ

はまらないように気を付けましょう!

#前任者のいない、ノウハウもない、ローカルラベルを多用している1万行のアセンブラコードの中にひっそりとありました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?