汇编-将数据区的字符串逆序输出

来源:互联网 发布:中国医药化工网数据库 编辑:程序博客网 时间:2024/06/06 10:00
data segmentstr db 'Hello World!','$'data endscode segment  assume cs:code,ds:datamain proc far  mov ax,data  mov ds,ax  lea si,str  mov cx,0LP1:  cmp byte ptr [si],'$'  je  output  inc si  inc cx  jmp LP1output:  lea si,str  add si,cx  dec si  mov dl,[si]  mov ah,02h  int 21h  dec si  loop output  mov ax,4c00h  int 21hcode ends  end main
原创粉丝点击