Valid Immediate Value(合法的立即數)

    What's the valid immediate value ?  Every valid immediate value is obtained from cyclically shifting an even number of bits of an 8-bit binary constant to right . 

    Let's just take an example . 

    0x12800000 is a valid immediate value . We expand it . 

    0x12 = 0001 0010;

    0x80 = 1000 0000;

    0x00 = 0000 0000;

    0x00 = 0000 0000;

    So 0x12800000 = 0001 0010 1000 0000 0000 0000 0000 0000 ;

    Let's see the first 10 bits --- 0001 0010 10 .

    And extract the lower 8 bits from it --- 0100 1010

    If we convert it into the hexidecimal it's the 0x4A , so the number 0x12800000 is obtained from cyclically shifting 10 bits of the binary number 0100 1010 to right . It accords with the definition of the Valid Immediate Value . So 0x12800000 is a valid immediate value . 

    However , let's talk about this number 0x0103C000 , is this a valid immediate number ?

    0x01=0000 0001

    0x03=0000 0011

    0xC0=1100 0000

    0x00=0000 0000 

    So the 0x0103C000=0000 0001 0000 0011 1100 0000 0000 0000; 

    Here this part 0000 0001 0000 0011 11 , from the first 1 to the last 1 , there are 11bits in total . Obviously it cannot stem from a 8-bit constant cyclically shifting . So it's not a valid immediate value . 

   

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值