Update for Mooreheim

This commit is contained in:
William Moore 2023-10-19 06:15:15 -05:00
parent 83dd75d73d
commit 524bfaab19

View File

@ -28,8 +28,6 @@
ORG 100H ORG 100H
; Driver logic ; Driver logic
LXI SP, 4000h
PUSH D PUSH D
LXI D, WELCOME LXI D, WELCOME
CALL PRINTS CALL PRINTS
@ -45,22 +43,14 @@
CALL ROLLTHEMBONES CALL ROLLTHEMBONES
CALL OUTPUT CALL OUTPUT
CHECKSWITCH6
IN 0FFH IN 0FFH
ANI 32 ANI 32
CNZ ROLLTHEMBONES CNZ ROLLTHEMBONES
IN 0FFH
ANI 32
JZ CHECKSWITCH6
CALL OUTPUT CALL OUTPUT
CHECKSWITCH7
IN 0FFH IN 0FFH
ANI 64 ANI 64
CNZ ROLLTHEMBONES CNZ ROLLTHEMBONES
IN 0FFH
ANI 64
JZ CHECKSWITCH7
CALL OUTPUT CALL OUTPUT
JMP 0h JMP 0h
@ -93,7 +83,6 @@ ROLLTHEMBONES
; Output the dice results ; Output the dice results
OUTPUT OUTPUT
PUSH D PUSH D
LXI D, YOUROLLED LXI D, YOUROLLED
CALL PRINTS CALL PRINTS
@ -163,6 +152,11 @@ OUTPUT
CALL PRINTS CALL PRINTS
POP D POP D
DCR L
DCR L
DCR L
DCR L
RET RET
; Roll the different dice ; Roll the different dice
@ -278,7 +272,7 @@ ROLL5_END
; Print a null-terminated string ; Print a null-terminated string
PRINTS PRINTS
; PUSH PSW PUSH PSW
OUT1CH OUT1CH
LDAX D ; LET A = (DE) LDAX D ; LET A = (DE)
CPI 0H ; Done when null terminated. CPI 0H ; Done when null terminated.
@ -287,7 +281,7 @@ OUT1CH
INR E ; Increment the address of the current character INR E ; Increment the address of the current character
JMP OUT1CH JMP OUT1CH
PRINTS_DONE PRINTS_DONE
; POP PSW POP PSW
RET RET
PRINTC PRINTC
; PUSH PSW ; PUSH PSW
@ -300,8 +294,8 @@ SAVE_HL DW 0
WELCOME DB "Welcome to the gambling halls of Mooreheim!", 0H WELCOME DB "Welcome to the gambling halls of Mooreheim!", 0H
DICE DB 0, 0, 0, 0, 0 DICE DB 0, 0, 0, 0, 0
HELD_DICE DB 0, 0, 0, 0, 0 HELD_DICE DB 0, 0, 0, 0, 0
NEWLINE DB CR, LF, 0H
YOUROLLED DB "You rolled:", CR, LF, 0H YOUROLLED DB "You rolled:", CR, LF, 0H
NEWLINE DB CR, LF, 0H
CR equ 0DH CR equ 0DH
LF equ 0AH LF equ 0AH