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?

Altair 8800​エミュレータで8086を使用する手順

0
Posted at

目的

8080の研究の為にAltair 8800のエミュレータを入れました。
Altair 8800​のエミュレータを導入
z80及び8080(ゲームボーイ,CP/M,NECV30)研究日記

弄っていると8086のCPUも対応していることが分かったので試してみました。
これまでにも8086のコードは色々書いてきましたが全てPC向けの処理であり、組み込みの様な使い方はしたことがありませんでした。
同じ8086でも外部接続機器がPCと違うのでVGA等はありません。
これから色々書いていく予定なので今回は8086の処理を書いて動かすまでの処理を記録しておきます。

実行結果

test@test-fujitsu:~/kaihatsu$ nasm -f bin -o alta8086.bin alta8086.asm
test@test-fujitsu:~/kaihatsu$ altairz80

Altair 8800 (Z80) simulator V3.8-1
sim> reset all
sim> set cpu 8086
sim> set sio ansi
sim> load alta8086.bin F0000
65536 bytes [256 pages] loaded at f0000.
sim> run
Hello, ALTAIR 8086

HALT instruction, PCX: F0023 (hlt)
sim> 

コード

alta8086.asm
; nasm -f bin -o alta8086.bin alta8086.asm
bits 16
org 0x0000

start:
    mov ax, 0xf000
    mov ds, ax
    mov es, ax
    mov ss, ax
    mov sp, 0x1000

    mov si, msg

loop:
    mov al, [ds:si]
    test al, al         ; 文字列末尾判定
    jz done

waita: ; waitは予約語
    in al, 0x10
    test al, 0x02
    jz waita
    
    mov al, [si]
    out 0x11, al
    inc si
    jmp loop
    
done:
    hlt
    jmp done

msg:
    db "Hello, ALTAIR 8086", 13, 10, 0

; 0埋め
times 0xFFF0 - ($ - $$) db 0

; リセットベクタ(CPU投電後に実行する1行目の命令)
    jmp 0xF000:start
times 11 db 0

※今回はスタックを使用していないがCALLを使い始めたら注意。

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?