简体   繁体   English

arm64-为什么低32bit都填1? 它不应该只有1个值吗?

[英]Arm64- why all filled with 1 the lower 32bit? Isn't it should be only 1 value?

mov x0, #1000

mov w6, #-1
add x7,x0,x6, sxtw

what will be the value of x6 and x7? x6 和 x7 的值是多少? [In hex] Here ans x6=0xffffffff //why all value of lower half filled with 1? [十六进制] 这里 ans x6=0xffffffff //为什么下半部分的所有值都用 1 填充? and how sxtw work when the ans will be 999 in decimal.以及当 ans 为十进制 999 时 sxtw 的工作方式。 I want to know details how this happening.我想详细了解这是如何发生的。

// 1= 000000000000000000000001 (On 32bit)
// -1= 111111111111111111111111
// So -1 in hex = 0xffffffff

The lower half of x6 will be filled with above value. x6 的下半部分将被上述值填充。

On 3rd statement it sign extends the value to 64bit so -1 is correct then it add 1000+(-1) and become value 999在第三条语句中,它符号将值扩展到 64 位,因此 -1 是正确的,然后它添加 1000+(-1) 并变为值 999

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果32位和64位CPU之间的唯一区别是它们的寄存器大小那么为什么必须为64位平台重写32位程序? - If the only difference between 32bit and 64bit CPUs is their register size then why must 32 bit programs be rewritten for a 64 bit platform? 为什么不是相反呢? TST算子ARM 32bit总成 - Why is it not the other way around? TST operator ARM 32bit assembly 在多线程系统中,使用 32 位 ARM 处理器以用户模式在程序集中编写 64 位原子操作(可能吗?) - using a 32bit ARM processor to write 64bit atomic operation in assembly in user mode in a multithreaded system (is it possible?) 32bit至64bit内联汇编端口 - 32bit to 64bit inline assembly porting 32 位和 64 位汇编程序之间的区别? - Difference between 32bit and 64bit Assembler Programs? 将汇编内联从32位转换为64位 - Converting Assembly Inline from 32bit to 64bit 将32位寄存器中的64位除以32位 - divide 64bit in two 32bit registers by 32bit 32位系统中64位字的操作 - Operations on 64bit words in 32bit system 在32位WinXP下使用64位数字 - Working with 64bit numbers under 32bit WinXP 在这种情况下,为什么编译器使用 32 位寄存器来传递指向 amd64 linux 上的函数的指针 - Why compiler use a 32bit register to pass a pointer to a function on a amd64 linux in this situation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM