汇编语言程序设计题目,在线等答案!!!!急!!!!!!!!!!
编制程序完成12h,45h,0F3h,6Ah,20h,0FEh,90h,0C8h,57h和34h等10字节数据之和,并将结果存入字节变量SUM1中,如没溢出,显示和SUM...
编制程序完成
12h,45h,0F3h,6Ah,20h,0FEh,90h,0C8h,57h 和34h等10字节数据之和,并将结果存入字节变量SUM1中,如没溢出,显示和SUM1,如果溢出,显示字符串‘overflow1’
同理,将12h,45h,0f3h,0a6h,20h,0feh,09h,0c8h,57h,34h等10字节数据之和,并将结果存入字节变量SUM2中,如没溢出,显示和SUM2,如果溢出,显示字符串‘overflow2’ 展开
12h,45h,0F3h,6Ah,20h,0FEh,90h,0C8h,57h 和34h等10字节数据之和,并将结果存入字节变量SUM1中,如没溢出,显示和SUM1,如果溢出,显示字符串‘overflow1’
同理,将12h,45h,0f3h,0a6h,20h,0feh,09h,0c8h,57h,34h等10字节数据之和,并将结果存入字节变量SUM2中,如没溢出,显示和SUM2,如果溢出,显示字符串‘overflow2’ 展开
2个回答
2010-12-27
展开全部
DATAS SEGMENT
bdata db 01h,02h,03h,04h,05h,06h,07h,08h,09h,0ah
sum db 00h
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;此处输入代码段代码
xor si,si
mov al,bdata[si]
mov bl,0
mov cx,10
again:
add bl,bdata[si]
inc si
loop again
mov sum,bl
mov al,[sum]
and al,0f0h
mov cl,4
shr al,cl
add al,30h
cmp al,39h
jbe next
add al,07h
next: mov ah,02h
mov dl,al
int 21h
mov al,[sum]
and al,0fh
add al,30h
cmp al,39h
jbe next1
add al,07h
next1: mov ah,02h
mov dl,al
int 21h
MOV AH,4CH
INT 21H
CODES ENDS
END START
bdata db 01h,02h,03h,04h,05h,06h,07h,08h,09h,0ah
sum db 00h
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;此处输入代码段代码
xor si,si
mov al,bdata[si]
mov bl,0
mov cx,10
again:
add bl,bdata[si]
inc si
loop again
mov sum,bl
mov al,[sum]
and al,0f0h
mov cl,4
shr al,cl
add al,30h
cmp al,39h
jbe next
add al,07h
next: mov ah,02h
mov dl,al
int 21h
mov al,[sum]
and al,0fh
add al,30h
cmp al,39h
jbe next1
add al,07h
next1: mov ah,02h
mov dl,al
int 21h
MOV AH,4CH
INT 21H
CODES ENDS
END START
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询