鱼C论坛

 找回密码
 立即注册
查看: 4217|回复: 1

[汇编作业] 实验11.4

[复制链接]
发表于 2017-5-14 18:35:36 | 显示全部楼层 |阅读模式

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

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

x
按书上要求写的代码,比较顺利。
  1. assume cs:codesg

  2. datasg segment
  3.         db "Beginner's All-purpose Symbolic Instruction Code.",0
  4. datasg ends

  5. codesg segment

  6. begin:
  7.         mov ax,datasg
  8.         mov ds,ax
  9.         mov si,0
  10.         call letterc
  11.        
  12.         mov ax,4c00h
  13.         int 21h
  14.        
  15. letterc:
  16.         push ax
  17.         push si
  18.         push bx
  19.         push cx
  20.        
  21.   s:
  22.         cmp byte ptr [si],0
  23.         je over
  24.         cmp byte ptr [si],97
  25.         jb s0
  26.         cmp byte ptr [si],122
  27.         ja s0
  28.         mov ax,32
  29.         sub [si],ax
  30.        
  31. s0:
  32.         inc si
  33.         jmp s
  34.        
  35. over:
  36.         pop cx
  37.         pop bx
  38.         pop si
  39.         pop ax
  40.         ret

  41. codesg ends
  42. end begin
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-7-6 20:37

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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