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

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[分享]汇编实验二加法

[复制链接]
发表于 2005-4-26 11:19:00 | 显示全部楼层 |阅读模式
data &nbsp; &nbsp;&nbsp; &nbsp;SEGMENT<br>
& k; ]* ~: R7 O; [, J& Mdata1 &nbsp; &nbsp; DB'72355+'<br>5 T" G9 `' K) d; K  M: Q1 [
data2 &nbsp; &nbsp; DB'45664= '<br>8 e( n7 ~7 `# h+ K
data3 &nbsp; &nbsp; DB 6 DUP(?),'$'<br>
/ a: e" ^9 v+ P+ h. sdata &nbsp; &nbsp;&nbsp; &nbsp;ENDS<br>* ?+ ]  d. C% ~1 O8 |
code &nbsp; &nbsp;&nbsp; SEGMENT<br>
8 D  e' S6 F$ d7 A2 k1 ^ASSUME CS:code,DS:data<br>
9 l; y( {- }. F, G: [4 i. ostart: &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>1 V9 G7 Z- }" s' e6 M: H% O3 `
l1: &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>2 J4 w: W2 O- H# u6 q
l2: &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; MOV [data3-1],31h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; JMP l22<br>
" o' X3 `9 I0 T* G! u6 }l21: &nbsp; &nbsp;&nbsp; &nbsp;MOV [data3-1],20h<br>
4 C) o3 {% J# e* u% E+ m/ {l22: &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>
) w. Z( Q/ l5 Z* r  q  M/ F4 ~code &nbsp; &nbsp; ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; END start <br>) \: o8 F  u+ _" t- ^! t/ R* n4 z
 楼主| 发表于 2005-4-26 11:20:00 | 显示全部楼层
附加题:<br># g* a4 u7 N9 P& j& g/ i& `! W: \0 E
data SEGMENT<br>
7 ?! G* n1 R8 ~6 S9 B( G0 }data1 DB ' 12345',10,13,'+'<br>! C+ S$ K6 @, B9 b' ^7 ~0 @" `8 F
data2 DB '67890',10,13,'------',10,13,' '<br>. c3 |/ b# ?. a: M
data3 DB 6 DUP(?),'$'<br>
# {6 U7 ~1 r) x) o7 l4 A" Fdata ENDS<br>
0 {; h+ c% n6 I3 ~5 s& Ecode SEGMENT<br>&nbsp; &nbsp; &nbsp;ASSUME CS:code,DS:data<br>. w/ _! t- t+ _& O: M
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>
8 L$ ^  D6 T' zagain1: 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>+ C/ ]8 L' i4 }% {1 y* K, U
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>; N/ c0 N  f- Z7 Y  y
d1: &nbsp; &nbsp; MOV &nbsp;[data3-1],20h<br>0 v! |7 |# j' U$ S+ c$ Y! f2 u
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>
) a: d% W& d, g8 Q6 z( w1 gcode &nbsp; &nbsp;ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;END start<br>
* k- l8 v- e, @* R  M" H1 I' X
发表于 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, 2025-1-31 06:15 , Processed in 0.055693 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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