Update to include Altair 8800 test.asm

This commit is contained in:
William Moore 2023-09-02 14:51:38 -05:00
parent c9205b6609
commit 80714dcbcf
2 changed files with 74 additions and 0 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.hex *.hex
*.prn

73
src/altair8800/test.asm Normal file
View File

@ -0,0 +1,73 @@
; test.asm
; Copyright (C) 2023 William R. Moore
;
; This program is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
;
; Outputs to the LEDs whichever sense switch is flipped until no switches are flipped
; in which case the program spits out Hello, world and exits.
;
; This serves no real purpose other than demonstrating concepts as a toy.
BDOS equ 0005h
WRITESTR equ 09h
WRITECHR equ 02h
CONSTAT equ 0bh
EOS equ 00h
CR equ 0dh
LF equ 0ah
org 0100h
lxi h, 0
mvi d, 080h
run:
ldax d
ldax d
ldax d
ldax d
dad b
jnc run
in 0ffh
mov d, a
CPI 0
jz print
jmp run
print:
push h
push b
mvi c, WRITESTR
lxi d, cls
call BDOS
pop b
pop h
push h
push b
lxi d, textstr
mvi c, WRITESTR
call BDOS
pop b
pop h
jmp exit
exit:
ret
textstr: db CR, LF, 'Hello, world', CR, LF, 24H
cls: db 1bh, '[2J$' ; ANSI clear screen: ESC [ 2 J
home: db 1bh, '[H$' ; ANSI go to screen home: ESC [ H
end