Skip to content

Commit

Permalink
Assembler+Bots: Really do error on unused labels
Browse files Browse the repository at this point in the history
This was incompletely implemented in f3332db,
and subsequently missed in the bot connect4/fill_board_with_mod.
  • Loading branch information
BenWiederhake committed Jun 24, 2023
1 parent 4a21505 commit 69dfb74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions assembler/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ def segment_bytes(self):
self.error(
f"Unused label(s), try using them in dead code, or commenting them out: {error_text}"
)
has_problem = True
if has_problem:
return None
segment = bytearray(SEGMENT_LENGTH)
Expand Down
4 changes: 2 additions & 2 deletions vms/connect4/fill_board_with_mod.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
lw r1, 0xFF89
lw r1, r1
b r1 _move_nonzero # (offset is +0x3)
.label _move_zero # On move 0, play in column 3.
# .label _move_zero # On move 0, play in column 3.
lw r0, 3
ret
.label _move_nonzero
lw r0, 18
ge r1 r0
b r0 _move_late # (offset is +0x2)
.label _move_early # On moves 1-17, play in column (n - 1) % 7.
# .label _move_early # On moves 1-17, play in column (n - 1) % 7.
decr r1
# j _move_late # Surprise optimization: This is a noop, this time!
.label _move_late # On moves 18-20, play in column n % 7.
Expand Down

0 comments on commit 69dfb74

Please sign in to comment.