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​のエミュレータ キーボード入力と画面表示

0
Posted at

動作環境の入れ方は以下を参照して下さい。
Altair 8800​のエミュレータを導入

bと入力するとすぐbと表示されます。

test@test-fujitsu:~/kaihatsu$ z80asm -o alta8080.bin alta8080.asm
test@test-fujitsu:~/kaihatsu$ altairz80

Altair 8800 (Z80) simulator V3.8-1
sim> reset all
sim> set cpu 8080
sim> set sio ansi
sim> load alta8080.bin
80 bytes [1 page] loaded at 0.
sim> run
Please input one character:
bb
HALT instruction, PC: 00019 (HLT)
sim> 
alta8080.asm
org 0
    ld sp, 0x1000
    ld hl, msg
    
loop:
    ld a, (hl) ; 表示する文字
    cp 0       ; 末尾なら終了
    jp z, done
    call putchar
    inc hl
    jp loop
    
done:
    call getchar
    call putchar
    
hang:
    halt
    jp hang
    
    
    
getchar:
waitg: ; 入力されないと無限ループ
    in a, (0x10)
    and 0x01
    jp z, waitg
    in a,(0x11) ; 入力された文字がaに入る
    
putchar:
waitp:
    ld b, a
    in a, (0x10)
    and 0x02
    jp z, waitp
    ld a, b
    out (0x11), a
    ret
    
msg: db "Please input one character:",13,10,0
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?