诚毅小家|集美大学生活【集美大学,诚毅学院,水产学院,师范学院,美术学院,财经学院,体育学院,航海学院,集美学村,石鼓路,龙舟池】

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 774|回复: 4

[分享]汇编实验二加法

[复制链接]
发表于 2005-4-26 11:19:00 | 显示全部楼层 |阅读模式
data &nbsp; &nbsp;&nbsp; &nbsp;SEGMENT<br>  N( u9 U! {& c4 q3 A$ k! y# {, h% o
data1 &nbsp; &nbsp; DB'72355+'<br>
8 w& k" {2 k( }) t: [2 q, Bdata2 &nbsp; &nbsp; DB'45664= '<br>
; c4 \3 U# ~, K4 S+ F; S$ zdata3 &nbsp; &nbsp; DB 6 DUP(?),'$'<br>
" j3 f- l* |# u2 Bdata &nbsp; &nbsp;&nbsp; &nbsp;ENDS<br>! `% t. C' H5 T5 J: l& e8 o5 p2 B6 X6 ?
code &nbsp; &nbsp;&nbsp; SEGMENT<br>: W6 |5 ^  R$ l0 e8 q9 y- a
ASSUME CS:code,DS:data<br>
: H: ?5 g- o  r4 y1 b0 P2 Y0 nstart: &nbsp; &nbsp; MOV AX,data<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MOV DS,AX<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; LEA SI,data1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; LEA DI,data2<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; LEA BX,data3<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MOV CX,5<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; CLC<br>
* a. \# a- e; o% {& L7 Hl1: &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; MOV AL,[SI+4]<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; ADC AL,[DI+4]<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; AAA<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; PUSHF<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; ADD AL,30h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; POPF<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MOV [BX+4],AL<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; DEC SI<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; DEC DI<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; DEC BX<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; LOOP l1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; JNC l21<br>
( k: j7 {' Z1 X8 ^8 Pl2: &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; MOV [data3-1],31h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; JMP l22<br>
* ^0 r6 y. g- f1 il21: &nbsp; &nbsp;&nbsp; &nbsp;MOV [data3-1],20h<br>
$ I1 L) ~" ?2 f6 W3 P3 rl22: &nbsp; &nbsp;&nbsp; &nbsp;MOV DX,OFFSET data1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MOV AH,09h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; INT 21h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; MOV AH,4ch<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; INT 21h<br>
+ c0 a: V+ u6 W* [code &nbsp; &nbsp; ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; END start <br>
& S9 x7 ]8 L' }, S: s5 m
 楼主| 发表于 2005-4-26 11:20:00 | 显示全部楼层
附加题:<br>6 }7 ^) r. w1 |" y9 ~; J, I
data SEGMENT<br>
" Y! R% U4 q& `% A# c7 A' rdata1 DB ' 12345',10,13,'+'<br>
! _1 N9 c" [  m" Y7 q# G, Sdata2 DB '67890',10,13,'------',10,13,' '<br>0 k8 o$ W0 p' r0 H* O$ t+ P
data3 DB 6 DUP(?),'$'<br># V; x$ s1 C  H/ l" o
data ENDS<br>5 m0 K& B& m  k) @; `. y
code SEGMENT<br>&nbsp; &nbsp; &nbsp;ASSUME CS:code,DS:data<br>
8 A5 |; F: w: h/ f/ g1 A; ^start: &nbsp;MOV AX,data<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;MOV DS,AX<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;LEA SI,data1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;LEA DI,data2<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;LEA BX,data3<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;CLC<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;MOV CX,5 &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; <br>& E! t6 s! W% x7 v2 N
again1: MOV AL,[SI+5]<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;ADC AL,[DI+4]<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;AAA<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;PUSHF<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;ADD AL,30h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;POPF<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;MOV [BX+4],AL<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;DEC SI<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;DEC DI<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;DEC BX<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;LOOP again1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;JNC &nbsp;d1 &nbsp; &nbsp;&nbsp; &nbsp;<br>; r  N4 E& X9 s# K
d0: &nbsp; &nbsp; MOV &nbsp;[data3-1],31h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;JMP &nbsp;d2 &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;<br>. s. }" i3 b4 ?6 ]) p
d1: &nbsp; &nbsp; MOV &nbsp;[data3-1],20h<br>% P  h, ^4 g. _4 q" K+ r% H
d2: &nbsp; &nbsp; MOV &nbsp;DX,OFFSET data1<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;MOV &nbsp;AH,09h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;INT &nbsp;21h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;MOV &nbsp;AH,4ch<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;INT &nbsp;21h<br>" V3 y$ F% i$ c2 W
code &nbsp; &nbsp;ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;END start<br>
+ h: }  v9 z! C2 P2 ~
发表于 2005-4-26 17:52:00 | 显示全部楼层
晕死了
发表于 2005-4-26 18:02:00 | 显示全部楼层
[audio03]
发表于 2005-4-27 15:14:00 | 显示全部楼层
小胖哪弄的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|诚毅小家 ( 小家社区工作室 闽ICP备05007965号 )

GMT+8, 2024-11-1 09:22 , Processed in 0.081004 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表