回 帖 发 新 帖 刷新版面

主题:有谁有 IBM PC汇编语言程序设计 第二版 温冬婵著的课后习题6.9答案

谝程序

回复列表 (共5个回复)

沙发

如果你得到了答案,就告诉我一声,谢谢!我的QQ是157085486!

板凳

日啊 不是有人编出来了吗 ?
你们没有看到?

3 楼

data segment
  mess1 db 13,10,"Input name         :$"
  mess2 db 13,10,"Input phone number :$"
  outline db 13,10,10,"NAME          TEL.",13,10,'$'
  inbuf db 30 dup(20h)
  outname db 20 dup(20h)
  outphone db 20 dup(20h)
data ends
code segment
main proc far
  assume cs:code,ds:data,es:data
start:
  mov ax,data
  mov ds,ax
  mov es,ax

  mov dx,offset mess1
  mov ah,09h
  int 21h
  call input_name

  mov dx,offset mess2
  mov ah,09h
  int 21h
  call inphone

  call printline

  mov ax,4c00h
  int 21h
main endp

input_name proc near
mov bx,0
lop1:
  call getchar  
  cmp al,13
  je out1
  
  mov inbuf[bx],al
  inc bx
  cmp bx,14
  jl  lop1
out1:

  mov cx,bx
  mov si,offset inbuf
  mov di,offset outname
  rep movsb
  mov outname[14],'$'
  ret
input_name endp

inphone proc near
mov bx,0
lop2:
  call getchar  
  cmp al,13
  je out2
  mov inbuf[bx],al
  inc bx
  jmp lop2
out2:

  mov cx,bx
  mov si,offset inbuf
  mov di,offset outphone
  rep movsb
  mov outphone[bx],'$'
  ret
inphone endp

getchar proc near
  mov ah,01h
  int 21h
  ret
getchar endp

printline proc near
  mov dx,offset outline
  mov ah,09h
  int 21h
  mov dx,offset outname
  mov ah,09h
  int 21h
  mov dx,offset outphone
  mov ah,09h
  int 21h

  ret
printline endp
code ends
  end start

4 楼

另一个版本的
.model small
.8086
.data
  msg_name  db 13,10,"Input name         :$"
  msg_phone db 13,10,"Input phone number :$"
  msg_tell  db 13,10,10,"  NAME                TEL.",'$'
  buf       db 20,0,21 dup(20h),20,0,21 dup(20h),'$'
.code
start:
  mov ax,@data
  mov ds,ax

  lea dx,msg_name
  mov ah,09h
  int 21h
  lea dx,buf[0]
  mov ah,0ah
  int 21h
  lea dx,msg_phone
  mov ah,09h
  int 21h
  lea dx,buf[23]
  mov ah,0ah
  int 21h
  lea dx,msg_tell
  mov ah,09h
  int 21h
  mov bh,0
  mov bl,buf[1]
  add bx,2
  mov buf[bx],20h
  mov bh,0
  mov bl,buf[24]
  add bx,25
  mov buf[bx],20h
  mov buf[0],13
  mov buf[1],10
  mov buf[23],20h
  mov buf[24],20h

  lea dx,buf[0]
  mov ah,09h
  int 21h
  mov ax,4c00h
  int 21h
end start

5 楼

汇编程序!
用汇编语言编写一个执行 “ R〈---X+Y-3 ”  计算的子程序COMPUTE:其中X,Y及R均为字数组。
COMPUTE与其调用程序都在同一代码段中,数据段D-SEG中包含x和y数组,数据段E-SEG中包含R数组,同时写出主程序调用COMPUTE过程的部分。
1,如果主程序和COMPUTE在同一程序模块中,但不在同一代码中,程序要如何修改??
2,如果主程序和COMPUTE不在同一模块中,程序要怎样修改!??

这道题目是汇编语言程序设计第2版第6章最后一题 !
知道的请尽快  恢复 谢谢 了!
飞鸟12
你这么强啊 帮也做啊!我也这几天要啊!

我来回复

您尚未登录,请登录后再回复。点此登录或注册