鱼C论坛

 找回密码
 立即注册
查看: 1926|回复: 0

王爽汇编语言实验10.3的问题

[复制链接]
发表于 2014-11-9 11:15:19 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. assume cs:code,ds:data,cs:stack

  2. data segment
  3. db 10 dup (0)
  4. data ends
  5. stack segment
  6. db 16 dup (0)
  7. stack ends
  8. code segment
  9. start:
  10. mov ax,stack
  11. mov ss,ax
  12. mov sp,16
  13. mov ax,12666
  14. mov bx,data
  15. mov ds,bx
  16. mov si,0
  17. call dtoc

  18. mov dh,8
  19. mov dl,3
  20. mov cl,2
  21. mov si,0
  22. call show_str

  23. mov ax,4c00h
  24. int 21h

  25. dtoc:mov cx,10
  26. div cx
  27. mov cx,ax
  28. jcxz ok
  29. add dx,30h
  30. mov ds:[si],dx
  31. mov dx,0
  32. inc si
  33. jmp short dtoc
  34. ok:
  35. add dx,30h
  36. mov ds:[si],dx
  37. ret

  38. show_str: push cx
  39. push dx
  40. mov al,dl;dl 是列数
  41. mov ah,0
  42. mov di,ax
  43. mov ax,0b800h
  44. mov es,ax
  45. mov cl,ds:[si];第一个字母
  46. mov ch,0
  47. jcxz ook
  48. mov al,160
  49. mul dh;dh是行数
  50. pop dx
  51. mov bx,ax
  52. mov es:[bx+di+1],cl
  53. pop cx
  54. mov es:[bx+di+2],cl
  55. inc si
  56. add di,2
  57. jmp short show_str
  58. ook:
  59. pop dx
  60. pop cx
  61. ret

  62. code ends
  63. end start
复制代码
代码如上,debug 的时候一切正常,直接在cmd下运行该程序是提示Divide overflow
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-7-3 12:42

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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