Encoding:

POOL32B

001000

A0

0

bit

base

ASET

0011

offset

6

2

3

5

4

12

Format:

ASET bit, offset(base)

microMIPS, MCU ASE

Atomically Set Bit within Byte

Purpose:

Atomically Set Bit within Byte

Description:

Disable interrupts;
temp = memory[GPR[base] + offset];
temp = (temp or (1 << bit));
memory[GPR[base] + offset] = temp;
Enable Interrupts;

The contents ofthe byte atthe memory location specified by the effective address are fetched. The specified bit within the byte is set to one. The modified byte is stored in memory at the location specified by the effective address.

The 12-bit signed offsetis added to the contents of GPR base to form the effective address. The read-modify-write sequence cannot be interrupted.

Transactions with locking semantics occurin some memory interconnects/busses.Itisimplementation-specific whether this instruction uses such locking transactions.

Restrictions:

is UNPREDICTABLE if an ASET instruction is executed in the delay slot of aThe operation ofthe processor branch or jump instruction.

Operation:

vAddr = sign_extend(offset) + GPR[base]
(pAddr, CCA) = AddressTranslation (vAddr, DATA, STORE)
pAddr = pAddrPSIZE-1..2 || (pAddr1..0 xor ReverseEndian2)
TempIE = StatusIE
StatusIE = 0
memword = LoadMemory (CCA, BYTE, pAddr, vAddr, DATA)
byte = vAddr1..0 xor BigEndianCPU2
temp = memword7+8*byte..8*byte
temp = temp or ( 1 || 0bit)
dataword = temp || 08*byte
StoreMemory (CCA, BYTE, dataword, pAddr, vAddr, DATA)
StatusIE = TempIE

Exceptions:

TLB Refill, TLB Invalid, TLB Modified, Address Error, Watch

Programming Notes:

Upon a TLB miss, a TLBS exception is signalled in the ExcCode field ofthe Cause register. For address error, a

ADES exception is signalled in the ExcCode field of the Cause register. For other data-stream related exceptions such as Debug Data Break exceptions and Watch exceptions, it is implementation-specific whether this instruction is treated as a load or as a store.