鱼C论坛

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

[技术交流] 实验10-3

[复制链接]
发表于 2011-11-6 17:58:59 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 18555587 于 2011-11-6 17:59 编辑
  1. assume cs:code

  2. data segment
  3. db 10 dup(0)
  4. data ends

  5. code segment
  6. start:
  7. mov ax,12666
  8. mov bx,data
  9. mov ds,bx
  10. mov si,0
  11. call dtoc

  12. mov dh,8
  13. mov dl,3
  14. mov cl,2
  15. call show_str

  16. mov ax,4c00h
  17. int 21h
  18. dtoc:
  19. mov bx,10
  20. mov di,0
  21. s2:
  22. mov dx,0
  23. div bx
  24. add dx,30h
  25. push dx
  26. inc di
  27. mov cx,ax
  28. jcxz s3
  29. jmp short s2
  30. s3:
  31. mov cx,di
  32. s4:
  33. pop ax
  34. mov [si],al
  35. inc si
  36. loop s4
  37. mov si,0
  38. ret
  39. show_str:
  40. mov ax,0b800h
  41. mov es,ax
  42. mov al,0a0h
  43. dec dh
  44. mul dh
  45. mov bx,ax
  46. mov al,2
  47. mul dl
  48. sub ax,2
  49. add bx,ax
  50. mov di,0
  51. mov al,cl
  52. mov ch,0
  53. s1:
  54. mov cl,[si]
  55. jcxz s
  56. mov es:[bx+di],cl
  57. mov es:[bx+di+1],al
  58. inc si
  59. add di,2
  60. jmp short s1
  61. s:
  62. ret
  63. code ends

  64. end start
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-7-7 16:25

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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