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

 找回密码
 注册

QQ登录

只需一步,快速开始

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

[分享]汇编实验二加法

[复制链接]
发表于 2005-4-26 11:19:00 | 显示全部楼层 |阅读模式
data &nbsp; &nbsp;&nbsp; &nbsp;SEGMENT<br>6 R) b) z! A8 h9 K3 \
data1 &nbsp; &nbsp; DB'72355+'<br>$ B  z6 g- V( L: o
data2 &nbsp; &nbsp; DB'45664= '<br>
# _+ Y! N) r$ C5 L  C$ G0 W7 pdata3 &nbsp; &nbsp; DB 6 DUP(?),'$'<br>. L6 S/ _6 v: e5 v2 C( f
data &nbsp; &nbsp;&nbsp; &nbsp;ENDS<br>6 g* ?( _+ Y0 |3 R; k
code &nbsp; &nbsp;&nbsp; SEGMENT<br>
6 o' w' n7 |3 A, h! [% w# kASSUME CS:code,DS:data<br>9 l, I1 g0 T- b' L, R$ Y% C
start: &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>: b; @5 C3 T/ R
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>
& K* T5 X& o0 Rl2: &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; MOV [data3-1],31h<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; JMP l22<br>' E* u) e% a- d2 y, X/ w. \; R1 K
l21: &nbsp; &nbsp;&nbsp; &nbsp;MOV [data3-1],20h<br>
" U, q5 k" [  @, w) }$ R" i2 Y# Bl22: &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>! Z0 {7 U" C8 s6 D3 e
code &nbsp; &nbsp; ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; END start <br>- F/ u  Z1 m( {' C5 v7 j
 楼主| 发表于 2005-4-26 11:20:00 | 显示全部楼层
附加题:<br>9 e( D- e0 P0 ?
data SEGMENT<br>: F2 ?9 V$ F& V, W6 f# \
data1 DB ' 12345',10,13,'+'<br>
7 Z4 S, c6 h  v3 n  W9 P9 Mdata2 DB '67890',10,13,'------',10,13,' '<br>4 T! h+ A) K4 [! U& |
data3 DB 6 DUP(?),'$'<br>
8 T, k% _! B6 Ddata ENDS<br>6 z/ c, m3 w( P6 V  ~, v, e( X: o
code SEGMENT<br>&nbsp; &nbsp; &nbsp;ASSUME CS:code,DS:data<br>3 m  E+ L$ R3 G. y
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 X8 O* I  a( ~7 q
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># q& F* w. o5 e' j4 F
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>
- X  ?8 s& F0 a& G, sd1: &nbsp; &nbsp; MOV &nbsp;[data3-1],20h<br>
" c5 y. Y) p: P; dd2: &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>
: ^' O5 l+ Y# jcode &nbsp; &nbsp;ENDS<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;END start<br>
% c0 K) ]% a( I& b
发表于 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-21 23:30 , Processed in 0.050029 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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