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