AT&T汇编中的数字

这篇博客详细介绍了AT&T汇编语言中的数字类型,包括无符号和有符号整数、二进制编码十进制、浮点数以及SIMD整数。涉及到的标准整数大小、MMX和SSE整数、浮点数格式和转换指令等,并提供了多个示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

数字类型

  • 无符号整数
  • 有符号整数
  • 二进制编码十进制
  • 压缩二进制编码十进制
  • 单精度浮点数
  • 双精度浮点数
  • 双扩展浮点数
    SIMD 扩展类型
    • 64位压缩整数
    • 128位压缩整数
    • 128位压缩单精度浮点数
    • 128位压缩双精度浮点数

整数

  • 标准的整数大小
    • Byte
    • Word
    • Doubleword
    • Quadword
  • 无符号整数
  • 有符号整数
# inttest.s - An example of using signed integers
.section .data
data:
	.int -45
.section .text
.globl _start
_start:
	nop
	movl $-345, %ecx
	movw $0xffb1, %dx
	movl data, %ebx
	movl $1, %eax
	int $0x80
  • 扩展无符号整数
    • 格式
      movzx source, destination
    • 示例
# movzxtest.s - An example of the MOVZX instruction
.section .text
.globl _start
_start:
	nop
	movl $279, %ecx
	movzx %cl, %ebx
	movl $1, %eax
	int $0x80
  • 扩展有符号整数
    • 格式
      movsx source, destination
    • 示例
# movsxtest.s - An example of the MOVSX instruction
.section .text
.globl _start
_start:
	nop
	movw $-79, %cx
	movl $0, %ebx
	movw %cx, %bx
	movsx %cx, %eax
	movl $1, %eax
	movl $0, %ebx
	int $0x80
  • 在GAS中定义整数
    • 示例
# quadtest.s - An example of quad integers
.section .data
data1:
	.int 1, -1, 463345, -333252322, 0
data2:
	.quad 1, -1, 463345, -333252322, 0
.section .text
.globl _start
_start:
	nop
	movl $1, %eax
	movl $0, %ebx
	int $0x80

SIMD 整数

  • MMX整数
    • 64位压
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值