汇编语言基于x86处理器第七版课后答案

Answers to End of Chapter Reviews and Exercises
for Assembly Language for x86 Processors, 7th Edition

Chapters 1 to 13
Revision date: 1/18/2014

Chapter 1
1.7.1 Short Answer Questions

  1. Most significant bit (the highest numbered bit).

  2. (a) 53 (b) 150 © 204

  3. (a) 110001010 (b) 110010110 © 100100001

  4. 00000110

  5. (a) 8 (b) 32 © 64 (d) 128

  6. (a) 12 (b) 16 © 16

  7. (a) 35DA (b) CEA3 © FEDB

  8. (a) 0000 0001 0010 0110 1111 1001 1101 0100
    (b) 0110 1010 1100 1101 1111 1010 1001 0101
    © 1111 0110 1001 1011 1101 1100 0010 1010

  9. (a) 58 (b) 447 © 16534

  10. (a) 98 (b) 1203 © 671

  11. (a) FFE8 (b) FEB5

  12. (a) FFEB (b) FFD3

  13. (a) 27641 (b) 16093

  14. (a) 19666 (b) 32208

  15. (a) −75 (b) +42 © −16

  16. (a) −128 (b) −52 © −73

  17. (a) 11111011 (b) 11010110 © 11110000

  18. (a) 10111000 (b) 10011110 © 11100110

  19. (a) AB2 (b) 1106

  20. (a) B82 (b) 1316

  21. 42h and 66d

  22. 47h and 71d

  23. 229 1, or 6.8056473384187692692674921486353 X 1038

  24. 286 1, or 77371252455336267181195263

  25. Truth table:

  26. Truth table: (last column is the same as #25)

  27. It requires 24 (16) rows.

  28. 2 bits, producing the following values: 00, 01, 10, 11

1.7.2 Algorithm Workbench

  1. Code example (C++)
    int toInt32(string s) {
    int num = 0;
    for(int i = 0; s[i] >= ‘0’ && s[i] <= ‘1’; i++) {
    num = num * 2 + s[i]-‘0’;
    }
    return num;
    }

  2. Code example (C++)
    int hexStrToInt32(string s) {
    int num = 0;
    for(int i = 0; ; i++) {
    if( s[i] >= ‘0’ && s[i] <= ‘9’ )
    num = num * 16 + s[i]-‘0’;
    else if( s[i] >= ‘A’ && s[i] <= ‘F’ )
    num = num * 16 + (s[i]-‘A’+10);
    else
    break;
    }
    return num;
    }

  3. Code example (C++)
    string intToBinStr( int n ) {
    vector stack;

    do {
    int quotient = n / 2;
    int remainder = n % 2;
    stack.push_back(remainder);
    n = quotient;
    } while( n > 0 );

完整答案链接:http://dt2.8tupian.net/2/23240a12b500.pg3

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Marhoosh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值