何か根本的に間違っているのかどうかはわかりません。Intelチップを搭載したLinuxマシンでAT&T構文のアセンブリ言語を学んでいます。INT 10H は、さまざまなビデオ目的で BIOS サブルーチンを呼び出すために使用されることを知りました。
画面をクリアするために、この簡単なアセンブリ コードを作成しました。
.section .data
data_items:
.section .text
.global _start
_start:
mov $6, %ah # to select the scroll function
mov $0, %al # the entire page
mov $7, %bh # for normal attribute
mov $0, %ch # row value of the start point
mov $0, %cl # column value of the starting point
mov $24, %dh # row value of ending point
mov $79, %dl # column value of the ending point
int $0x10 # invoke the BIOS INT 10H interrupt
movl $1, %eax # exiting the program
int $0x80
私はそれをgnome端末で組み立てました(Intelチップでfedora 19を使用)。組み立てとリンクは問題ありませんでした。しかし、実行に失敗し、セグメンテーション違反が表示されます。失敗した理由とコードの修正方法