Update for blinkenlights.asm

This commit is contained in:
William Moore 2023-12-23 22:36:23 -06:00
parent be7709e040
commit 811766af00

View File

@ -1,3 +1,22 @@
; blinkenlights.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/>.
; Modified from https://github.com/kloyd/Retro8080/blob/main/funstuff/blinken_pattern.asm
; to run in CP/M and with my own pattern.
ORG 100H ORG 100H
INIT LXI H,DATA ; HL points to blinken data INIT LXI H,DATA ; HL points to blinken data
SHLD SAVE_HL SHLD SAVE_HL
@ -10,10 +29,9 @@ GETD LHLD SAVE_HL ; restore HL
INR L ; HL++ INR L ; HL++
SHLD SAVE_HL ; Save data SHLD SAVE_HL ; Save data
INPDEL LXI H,0 ; Init HL to zero before starting the delay loop INPDEL LXI H,0 ; Init HL to zero before starting the delay loop
IN 0ffh IN 0FFH
CPI 0ffh ; All Sense switches on is a HALT. CPI 0FFH ; All Sense switches on is a HALT.
JZ DONE JZ DONE
ADI 1 ADI 1
MOV C,A ; sense switches to B MOV C,A ; sense switches to B
@ -25,56 +43,37 @@ BLINK LDAX D
LDAX D LDAX D
DAD B DAD B
JNC BLINK JNC BLINK
; Done with this loop go get the next D
JMP GETD JMP GETD
; Done with this loop go get the next D
; Halt if FF on sense switches. Some way to drop out. ; Return to CP/M if FF on sense switches. Some way to drop out.
DONE HLT DONE JMP 0H
; Somewhere to save HL, since it will get clobbered by the delay routine. ; Somewhere to save HL, since it will get clobbered by the delay routine.
SAVE_HL DW 0 SAVE_HL DW 0
; Put your pattern list here... this is just jiggy wiggy back forth here. ; Put your pattern list here... this is just jiggy wiggy back forth here.
DATA DATA
DB 00010001b DB 10111010b
DB 00100010b DB 11000011b
DB 01000100b DB 11011111b
DB 10001000b DB 10001000b
db 00010001b DB 01001000b
db 00100010b DB 00110000b
DB 01000100b DB 01000110b
db 10001000b DB 10000010b
db 00010000b DB 01101010b
db 00100000b DB 01000000b
db 01000000b DB 00100111b
db 10000000b DB 01010111b
db 00000000b DB 00100000b
db 10000000b DB 11110010b
db 11000000b DB 01101111b
db 01100000b DB 10000011b
db 00110000b DB 00110011b
db 00011000b DB 00010101b
db 00001100b DB 10001100b
db 00000110b DB 10111011b
db 00000011b DB 00000000b
db 00000001b
db 00000000b
db 00000001b
db 00000011b
db 00000111b
db 00001111b
db 00011111b
db 00111111b
db 01111111b
db 11111111b
db 11111110b
db 11111100b
db 11111000b
db 11110000b
db 11100000b
db 11000000b
db 10000000b
db 00000000b
DB EOF DB EOF