-
Notifications
You must be signed in to change notification settings - Fork 3
PM_Opc_EX
Jose I Romero edited this page Dec 6, 2019
·
1 revision
== EX = Expand Register ==
Hex | Mnemonic | Cycles |
---|---|---|
CE A8 | EX BA, A | 12 |
A = (8-Bits) Register A
BA = (16-Bits) Register BA: (B shl 8) or A
; EX BA, A
;
; BA = Destination
; A = Source
IF (A AND 0x80) THEN ; Check for sign
B = 0xFF
ELSE
B = 0x00
ENDIF
EX expands register A into BA, turning a signed 8-bits value into 16-bits.
None
; A = 0x05 (5)
EX`` ``BA,`` ``A
; BA = 0x0005 (5)
; A = 0xF9 (-7)
EX`` ``BA,`` ``A
; BA = 0xFFF9 (-7)
; A = 0x00 (0)
EX`` ``BA,`` ``A
; BA = 0x0000 (0)
; A = 0x7F (127)
EX`` ``BA,`` ``A
; BA = 0x007F (127)
; A = 0x80 (-128)
EX`` ``BA,`` ``A
; BA = 0xFF80 (-128)