注册 登录
编程论坛 汇编论坛

大家谁会这两道汇编题目啊?!帮帮忙啦~~

liyuying1987 发布于 2008-06-16 19:41, 932 次点击
1、阅读下列程序回答问题
stack    segment     stack
dw  100dup (0)  
stack    ends
data segment
bin dw   7462
buf db   6   dup(0), 0dh, 0ah,’$’
ten dw   10
data ends
code segment
assume     cs: code , ds : data, ss: stack
start:        mov  ax, data
            mov  ds, ax
            mov  ax, bin
            or    ax, ax
            jns   plus
            neg   ax
            mov  buf, ‘—‘
            jmp   next
plus:        mov   buf, ‘+’
next:        mov   cx, 5
l1:          mov   dx, 0
            div   ten
            push     dx
            loop l1
            mov   cx, 5
            lea    bx, buf+1
l2:          pop   ax
            add   al, 30h
            mov  [bx], al
            inc    bx
loop l2
lea    dx, buf
mov   ah, 9
int     21h
mov    ah, 4ch
int      21h
codeends
            end    start
给程序添加必要注释。
画出程序框图。
指出程序的功能。
调试程序并写出程序的执行结果。
2、下列程序完成将键盘输入的两个字符串连接并分散对齐显示输出功能,补充并完成下列程序段,要求给程序添加必要注释,给出程序框图及程序的执行结果
       data segment
       dum    equ 60
       p1 db 0ah, 0dh, ‘string:’,’$’
       p2 db 0ah, 0dh,’right-adjusting of string:’,0ah, 0dh,’$’
       string1 db  num,0,num dup(‘’),0ah,0dh,’$’
       string2 db  num,0,num dup(‘’),0ah,0dh,’$’
       data ends
       stack1 segment para stack
            dw 20h dup(0)
       stack1ends
       code segment
            assume cs:code,ds:data,ss:stack1,es:data
       start:
      
      











code ends
        end    start
0 回复
1