-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Milestone
Description
Implement the BIAND 6309 instruction mnemonic in the assembler. Logically ANDs the specified bit in the A, B, or CC with an inverted bit in memory. Result is stored in the source register. Direct addressing mode only. The first two bytes of the instruction are the instruction code, the next byte is a postbyte, and the last byte is the address least significant byte.
Direct - $1131, 4 bytes
Example:
BIAND B,2,4,$40
The above would AND bit 4 of B with the inverted value of bit 2 of DP:40, storing the result in B. Note the strange order here - following B you specify the bit in the memory location, followed by the bit in the register. The resulting machine code would be:
11 31 A2 40
The postbyte is composed of the following sections:
- Bits 7-6: register code where 00 =
CC, 01 =A, 10 =B, 11 = invalid - Bits 5-3: the bit number (0-7) in memory
- Bits 2-0: the bit number (0-7) in the register