assembly


address-size override with near calls in long mode


Intel manual (Vol.2 paragraph 2.2.1.6) says:
The use of the address-size prefix does not disable RIP-relative
addressing. The effect of the address-size prefix is to truncate and
zero-extend the computed effective address to 32 bits.
CALL rel32 description says:
Call near, relative, displacement relative to next instruction. 32-bit
displacement sign extended to 64-bits in 64-bit mode
Thus, rel32 is immediate rather than address, as operand-size prefix overrides the default value.
But if use address-size override prefix with near call (or jmp), will it zero-extend effective address as described above or it won't have any effect?
That isn't the type of RIP-relative addressing that a 67-prefix might target, a 67-prefix has no effect on call/jmp/jcc offsets (rather it is the 66-prefix that affects, for example, call rel16 vs call rel32).
The type of RIP-relative addressing par 2.2.1.6 talks about is the sort of thing encoded by a ModRM byte that looks like 00***101, for example in something like
mov rax, [eip]
; or,
addr32 mov rax, [eip]
; or if your assembler doesn't let you write either of those,
db 67
mov rax, [rip]
this is one of the cases they meant, where rip-relative addressing is still active but truncated. If addressing reverted completely like how it is in 32bit mode, a ModRM like 00***101 would encode [sword] with no eip-involvement at all.

Related Links

Relative jump out of range by
Modify asm instructions in an ELF binary
x86 Assembly - idiv to get decimal places
Assembly: Convert hex string into single byte [duplicate]
how to acpi shutdown in assembly in custom os?
MIPS instructions to extract a field from a register
Understanding Assembly Hello World
Assembly memory math and looping
How do I de-reference a PTR in assembly?
QtSpim: (parser) syntax error on line 6
The program shows error when assembling using nasm
assembly reverse a string
we see virtual address of a process (in paging system), where does these virtual address exist?
My code prints out garbage instead of the desired text
Which segment register is used by default?
Combining two 8 bit registers to form a 16 bit variable

Categories

HOME
sonarqube
adal
fpga
yahoo-finance
database-normalization
carousel
google-apps
odoo-8
performancepoint
32bit-64bit
jxl
php-5.6
speech-synthesis
flash-player
enterprise-miner
systemtime
roundup
onload
slidetoggle
jquery-multiselect
fable-f#
shared
twiml
zend-debugger
mockjax
laravel-eloquent
sammy.js
login-script
gojs
classcastexception
fiware-cygnus
health-monitoring
demo
hackintosh
mcustomscrollbar
xv6
apriori
attributeerror
logback-groovy
angular-http
nanoc
openrasta
twilio-click-to-call
zenhub
scalding
quicktime
payload
type-theory
polyline
rocks
cubism.js
async.js
model-associations
wso2developerstudio
firebase-security
respondcms
turbo-prolog
kendo-upload
user-management
inf
vhosts
concurrentmodification
toran-proxy
grgit
dllimport
roadkill-wiki
rate-limiting
sony-lifelog-api
atoi
sql-server-data-tools
jsvc
matlab-deployment
jquery-forms-plugin
viewer
strawberry-perl
rcaller
file-not-found
embedded-fonts
away3d
hidapi
unit-of-work
beaker-testing
cardreader
virtual-pc
argouml
sqlclr
curb
extreme-programming
pstack
qtconcurrent
vfs
web-farm
xcode3.2
kqueue
infobright
google-maps-mobile
workflow-services
nhprof
objective-j
fault-tolerance
flvplayback
information-management
pbcopy
commercial-application

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App