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?

現代PCと8086実機でVGAモードを動かしてみた

Posted at

目的

VGAでVRAMいっぱいにピンクを描画し、8086実機及びThinkPadX280で起動する。
現代のパソコンでもVGAは生きているのかを調べる。
8086実機はおまけ程度の意味で試しただけ。

ソースコード

pink.asm
; nasm -f bin -o pink.bin pink.asm
; qemu-system-x86_64 -drive format=raw,file=pink.bin
; lsblk
; sudo dd if=pink.bin of=/dev/sdb bs=512 count=1 conv=notrunc

[bits 16]
org 0x7C00

start:
    ; VGAモード 0x13 (320x200, 256色)
    mov ax, 0x13
    int 0x10

    ; ビデオメモリの開始アドレス (0xA0000)
    mov ax, 0xA000
    mov es, ax
    xor di, di

    ; 画面のピクセル数
    mov cx, 320*200

    ; ピンク色の設定 
    mov al, 0xD

fill_screen:
    mov [es:di], al
    inc di
    loop fill_screen

    jmp $

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

8086実機

成功。
73ae83ad933e6.jpg

ThinkPad X280

BIOSをレガシーに変更すると起動し、ピンクの画面が表示された。
※決してエミュレータではない
e75e54891150f.jpg
8b364809a82188.jpg

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?