微型计算机原理与接口技术 第二版 张荣标答案第5章(国外英文资料).doc

微型计算机原理与接口技术 第二版 张荣标答案第5章(国外英文资料).doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
微型计算机原理与接口技术 第二版 张荣标答案第5章(国外英文资料)

微型计算机原理与接口技术 第二版 张荣标答案第5章(国外英文资料) The answer to the problem in section 5 of the microcomputer principle Try to write an assembler, which requires the implementation of converting two decimal Numbers from ASCII to one byte. DATA SEGMENT ASC DB 36H, 35H ASCEND DB? DATA ENDS CODE SEGMENT Im going to ASSUME that Im going to ASSUME that Im going to do it DECIBIN PROC FAR MOV AX, DATA MOV DS, AX MOV BX, OFFSET ASC MOV, [BX] CMP AL, 30H JL EXIT CMP AL, 39H JG EXIT SUB AL, 30H MOV DL, [BX + 1] CMP DL, 30H JL EXIT CMP DL, 39H JG EXIT SUB DL, 30H MOV CL 10 MUL CL ADD AL, DL MOV ASCEND, AL EXIT: MOV AH, 4CH INT 21H DECIBIN ENDP CODE ENDS END DECIBIN There are 20 single byte counts in a storage area, and try to write a assembly language to find the absolute value and return it to its original location. DSEG SEGMENT Lets keep MUM DB 1, 2, 3, -9, 0, 7, 5, -4, -7, -11,34, -67, -44, -51, 1, 1, 1, 3, 6, 8, 9, 3 DSEG ENDS CSEG SEGMENT (c) START PROC FAR PUSH DS XOR AX, AX PUSH AX MOV AX, DSEG MOV DS, AX MOV CX 20 MOV SI, OFFSET MUM LP1: MOV AL, [SI] AL, AL JNS DONE NEG AL DONE: MOV [SI], AL INC SI LOOP LP1 MOV AH, 4CH INT 21H START ENDP CSEG ENDS END START Try to write an assembly program to take the inverse of AX, and then figure out the number of 0 in AX, and save the result to CL. CODE SEGMENT MAIN PROC FAR ASSUME CS: CODE START: MOV AX, 0E001H MOV DL, zero MOV CL 16 NOT AX RETEST: AND AX, AX JS SKIP INC DL SKIP: SHL AX, 1 LOOP RETEST MOV CL, DL EXIT: MOV AH, 4CH INT 21H MAIN ENDP CODE ENDS END START The a1 ~ a20 is stored in the data area of BUF, in turn, with two bytes for each data and two bytes for the SUM. Try to programmatically calculate SUM = a1 + a2 + a3 +... + a20 DATA SEGMENT DAT DW 0, 1, 8, 8, 27, 64, -9, -5, 6, 77, -5, 5, 5, 8, 9, 3, 5, 5, 5, 6, 87 SUM DW? DATA ENDS CODE SEGMENT MAIN PROC FAR Im going to ASSUME that Im going to ASSUME that Im going to do it START: MOV AX, DATA MOV DS, AX MOV AX, zero MOV SUM, AX MOV SI, OFFSET DAT MOV CX 20 LP1: ADD AX, [SI] INC SI IN

您可能关注的文档

文档评论(0)

f8r9t5c + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

版权声明书
用户编号:8000054077000003

1亿VIP精品文档

相关文档