私は初めてのアセンブリ プログラミングのクラスを受講していますが、インストラクターは、ベース アドレッシング モードがどのように機能するかを調べてほしいと言っています。そのため、これを行うために私が書いたコードをいくつか示します。唯一の問題は、セグメンテーション違反が発生し続けるため、理解できないことです。私は彼らが何をしていると思うかを示すために、行にコメントしました。誰かが私の誤解を正してくれませんか。
ありがとう!
.text
.global _start
L0: .int 0x99999999
L1: .int 0x12345678
L2: .int 0x11111111
_start:
movl $L1, %eax #Stores the address of what L1 "pionts to" in regester eax
movb $0, 2(%eax) #Stores 0 in the location eax has in it +2 memory locations
#So 0 should be stored in the same place as L1+2
checkHere:
movl $1,%eax
movl $0,%ebx
int $0x80