了解程序集中的程序

时间:2017-04-29 01:40:23

标签: assembly

我正在尝试理解程序中的一部分程序,但我并没有真正理解。有人能解释一下这些代码行是如何工作的吗? 我读到代码.long num表示带有该值的long,但是这种接缝并非如此 谢谢!

 nums:   // storing an array of numbers
     .long 1 + 3   // Does this mean that we are soring the number 4 in nums?  
     .long 2 * 12  //storing 24?
     .long 0x3 | 0x772   //  storing one or another hexidecmial number?  
     .long 4     // storing the number 4? 
     .long 5     // storing the number 5 

 .equ size, 5 # #define size 5

1 个答案:

答案 0 :(得分:0)

嗯, .long 告诉汇编程序保留4个字节的内存。然后,计算作为参数给出的表达式,并用结果初始化此内存位置。

在您的示例中,位置 nums 的值将 4 nums + 4 24 nums + 8 两个十六进制值之间的按位逻辑OR (运算符|)等。

所以它完全有意义作为一个数字数组(正如你的评论所说),因为有一些数字存储在连续的内存位置。

相关问题