Update to fix logic issues

This commit is contained in:
William Moore 2023-10-19 14:37:11 -05:00
parent d8075e1b95
commit c483f5b192

View File

@ -44,38 +44,77 @@
CALL ROLLTHEMBONES
CALL OUTPUT
ROUND2
IN 0FFH
ANI 32
CNZ ROLLTHEMBONES
JZ ROUND2
CALL ROLLTHEMBONES
CALL OUTPUT
ROUND3
IN 0FFH
ANI 64
CNZ ROLLTHEMBONES
JZ ROUND3
CALL ROLLTHEMBONES
CALL OUTPUT
JMP 0h
ROLLTHEMBONES
MOV A, C
CPI 0
JNZ RTB1
CALL ROLL1
MOV M, C
INR L
INR 1
CALL ROLL2
MOV M, C
INR L
INR 1
CALL ROLL3
MOV M, C
INR L
INR 1
CALL ROLL4
MOV M, C
INR L
INR 1
CALL ROLL5
MOV M, C
JMP RTBEND
RTB1
IN 0FFH
ANI 1
JNZ RTB2
CALL ROLL1
MOV M, C
RTB2
INR L
IN 0FFH
ANI 2
JNZ RTB3
CALL ROLL2
MOV M, C
RTB3
INR L
IN 0FFH
ANI 4
JNZ RTB4
CALL ROLL3
MOV M, C
RTB4
INR L
IN 0FFH
ANI 8
JNZ RTB5
CALL ROLL4
MOV M, C
RTB5
INR L
IN 0FFH
ANI 16
JNZ RTBEND
CALL ROLL5
MOV M, C
RTBEND
DCR L
DCR L
DCR L
@ -162,9 +201,6 @@ OUTPUT
; Roll the different dice
ROLL1
IN 0FFH
ANI 1
JNZ ROLL1_TEST
ROLL1_START
MVI C, 0
ROLL1_DIE
@ -176,17 +212,10 @@ ROLL1_DIE
ANI 1
JNZ ROLL1_END
JMP ROLL1_DIE
ROLL1_TEST
MOV A, M
CPI 0h
JZ ROLL1_START
ROLL1_END
RET
ROLL2
IN 0FFh
ANI 2
JNZ ROLL2_TEST
ROLL2_START
MVI C, 0
ROLL2_DIE
@ -198,17 +227,10 @@ ROLL2_DIE
ANI 2
JNZ ROLL2_END
JMP ROLL2_DIE
ROLL2_TEST
MOV A, M
CPI 0
JZ ROLL2_START
ROLL2_END
RET
ROLL3
IN 0FFh
ANI 4
JNZ ROLL3_TEST
ROLL3_START
MVI C, 0
ROLL3_DIE
@ -220,17 +242,10 @@ ROLL3_DIE
ANI 4
JNZ ROLL3_END
JMP ROLL3_DIE
ROLL3_TEST
MOV A, M
CPI 0
JZ ROLL3_START
ROLL3_END
RET
ROLL4
IN 0FFH
ANI 8
JNZ ROLL4_TEST
ROLL4_START
MVI C, 0
ROLL4_DIE
@ -242,17 +257,10 @@ ROLL4_DIE
ANI 8
JNZ ROLL4_END
JMP ROLL4_DIE
ROLL4_TEST
MOV A, M
CPI 0
JZ ROLL4_START
ROLL4_END
RET
ROLL5
IN 0FFh
ANI 16
JNZ ROLL5_TEST
ROLL5_START
MVI C, 0
ROLL5_DIE
@ -264,10 +272,6 @@ ROLL5_DIE
ANI 16
JNZ ROLL5_END
JMP ROLL5_DIE
ROLL5_TEST
MOV A, M
CPI 0
JZ ROLL5_START
ROLL5_END
RET
@ -284,11 +288,10 @@ OUT1CH
PRINTS_DONE
POP PSW
RET
PRINTC
; PUSH PSW
LDAX D ; LET A = (DE)
OUT 1H ; Output the character at the current address to the console
; POP PSW
RET
SAVE_HL DW 0