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?

「手探りでCUI OS作成に挑む」関数説明篇 clear_screen(画面クリア)

Last updated at Posted at 2025-05-13

「手探りでCUI OS作成に挑む」連載

この記事は「手探りでCUI OS作成に挑む」連載の一部です。
全体の目次は「手探りでCUI OS作成に挑む」連載目次を御覧下さい。

目的

この関数は、画面を真っ白にしたい時に使う基本命令です。

検証コード

テキストモード80x25を設定するとBIOSが画面を初期化するので、現在表示されている文字が全て消去される。

[org 0x7C00]
[bits 16]

start:
    call clear_screen  ; 関数呼び出し
    hlt               ; CPU停止

clear_screen:
    mov ax, 0x0003    ; 80x25テキストモード
    int 0x10
    ret

times 510-($-$$) db 0
dw 0xAA55

動作確認

nasm -f bin boot.asm -o boot.bin
qemu-system-i386 -fda boot.bin

image.png

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?