"{ Package: 'jv:dragonfly/asm' }"
"{ NameSpace: Smalltalk }"
AJx86GPRegister subclass:#AJx64RipRegister
instanceVariableNames:''
classVariableNames:''
poolDictionaries:'AJx86Registers'
category:'AsmJit-x86-Operands'
!
AJx64RipRegister comment:'Virtual registers used for relative instruction pointer addressing in 64Bit mode
In IA-32 architecture and compatibility mode, addressing relative to the instruction pointer is available only with control-transfer instructions. In 64-bit mode, instruc- tions that use ModR/M addressing can use RIP-relative addressing. Without RIP-rela- tive addressing, all ModR/M instruction modes address memory relative to zero.'
!
!AJx64RipRegister methodsFor:'accessing'!
code
self ripAccessError
!
index
self ripAccessError
!
influencingRegisters
self is16
ifFalse: [ ^ self as16 influencingRegisters ].
^ { self as16. self as32. self as64 }
! !
!AJx64RipRegister methodsFor:'converting'!
as16
^ AJx86Registers at: #IP
!
as32
^ AJx86Registers at: #EIP
!
as64
^ AJx86Registers at: #RIP
!
as8
self error: 'No 8bit register available for instruction pointer relative addressing'
! !
!AJx64RipRegister methodsFor:'error'!
ripAccessError
self error: 'RIP register ', self name, ' cannot be used only for relative addressing'
! !
!AJx64RipRegister methodsFor:'printing'!
descriptionOn: s
s nextPutAll: 'A '; print: self size * 8; nextPutAll: 'bit instruction pointer register'.
! !
!AJx64RipRegister methodsFor:'testing'!
isGeneralPurpose
^ false
!
isRip
^ true
!
isUpperBank
^ false
!
isX86
^ false
! !