Skip to content

Implement instruction: ASL, ASR #12

@tjhancocks

Description

@tjhancocks

Feature Request
An implementation for the ASL, ASR instruction needs to be added to the emulation layer. Below is a brief description of the ASL and ASR instructions taken from the M68000 Programmers Reference Manual.

Arithmetically shifts the bits of the operand in the direction (L or R) specified. The carry bit receives the last bit shifted out of the operand. The shift count for the shifting of a register may be specified in two different ways:

  1. Immediate—The shift count is specified in the instruction (shift range, 1 – 8).
  2. Register—The shift count is the value in the data register specified in instruction modulo 64.

The size of the operation can be specified as byte, word, or long. An operand in mem- ory can be shifted one bit only, and the operand size is restricted to a word.
For ASL, the operand is shifted left; the number of positions shifted is the shift count. Bits shifted out of the high-order bit go to both the carry and the extend bits; zeros are shifted into the low-order bit. The overflow bit indicates if any sign changes occur dur- ing the shift.

Describe the solution you'd like
The solution should match the existing conventions and patterns used by other implemented instructions. At the time of reporting this only includes the ABCD instruction.

Describe alternatives you've considered
N/a

Additional context
N/a

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