tbegin.

Transaction Begin

tbegin. R

Initiates a hardware transaction. If the transaction fails, execution rolls back to this point. Sets CR0 based on success/failure.

Details

Initiates a hardware transaction, setting the transaction active state and recording checkpoint information. If execution completes successfully within the transaction, tbegin. sets CR0[EQ] = 1; if the transaction is aborted, execution rolls back to this instruction and CR0[EQ] = 0, with CR0[SO] indicating the abort cause. The R field determines whether a transaction failure causes an external rollback (R=0) or an internal retry (R=1). Requires Transactional Memory (TM) facility support.

Pseudocode Operation

if transaction initiated successfully then CR0[EQ] ← 1 else CR0[EQ] ← 0; CR0[LT,GT,SO] set based on abort cause; transaction state is active

Programming Note

In synthetic TM mode, transactions initiated by tbegin will fail immediately, invoking the failure handler. Ensure that your application logic correctly handles transaction failures to maintain data integrity.

Example

tbegin. 0

// Start atomic hardware transaction.

Encoding

Binary Layout
31
0
/
6
R
11
/
16
654
21
1
31
 
Format X-form
Opcode 0x7C00051D
Extension Transactional Memory
Registers Altered CR0

Operands

  • R
    Rollback Handler (0=External, 1=Internal)