Byte vs Long vs word in GAS assembly

时间:2017-08-30 20:07:36

标签: assembly gas

This code is accessing all elements correctly(like this):

<?php

require_once 'dbconfig.php';
require_once 'class.channel.php';

$currNum = $_POST['currentNumber'];

$seqNum = query( "SELECT currval('followers_count')" );

if ($seqNum == $currNum){
    exit(0);
}

$newNum = query("SELECT FROM follow WHERE followers_count > ".$currNum);

while ( $change1 = fetch_result( $newNum ) ) {
    echo "<count1>".$change1."</count1>";
}

?>

But this code gives garbage :

<div>
  <div id="follow_count"></div>
</div>

<script type="text/javascript">
$.post("changes.php", 
        { currentNumber },
        function(dat){
            $(dat).find('count1').each( function() {
                $('#follow_count').append(""+$(this).text()+"");
            });
});
</script>

I am using 64-bit Linux using GAS assembler and using gdb for debugging and checking the register values.

r = rle(x) val = max(x,na.rm=T)+1 r$values[r$values==0 & r$lengths>2] = val x2 = inverse.rle(r) temp = cumsum(x2 == val) split(x2[x2!=val], temp[x2!=val]) $`0` [1] 1.00000 1.00000 2.00005 1.00000 1.00000 $`4` [1] 1 2 0 3 4 $`8` [1] 1 2 3 1 3 displays exact value while .data s : .long 7,2,3,5 .text .globl _start _start: movl s+4,%eax # second number in s movl $1,%eax movl $0,%ebx int $0x80 and .data s : .word 7,2,3,5 .text .globl _start _start: movl s+4,%eax # third number in s movl $1,%eax movl $0,%ebx int $0x80 give garbage value. long gives word for byte but 131079 for display s.

I am new to this, is 7 not used in GAS or is there a type conversion going on?

0 个答案:

没有答案