Skip to content

Implement BRGE and BRLT signed branch instructions #10

Description

@sql-hkr

Currently, our Tiny8 CPU simulator supports unsigned branch instructions such as BRCS and BRCC.
To fully support signed comparisons, we need to implement the BRGE (Branch if Greater or Equal,
Signed) and BRLT (Branch if Less Than, Signed) instructions.

Tasks:

  • Implement BRGE to branch when Rd >= Rr for signed integers.
  • Implement BRLT to branch when Rd < Rr for signed integers.
  • Ensure the instructions correctly use the S flag (S = N xor V) from SREG.
  • Add unit tests demonstrating signed comparisons.

References:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions