zoukankan      html  css  js  c++  java
  • 汇编,小写字母转大写字母【解惑】

    ;Ex502
    dseg segment
    Msg1 db 'Input a lowercase letter:$'
    Msg2 db 0dh,0ah,'Uppercase letter is:'
    Result db ?
      db '$'
    dseg ends

    cseg segment
      assume cs:cseg,ds:dseg
    Start:
      mov ax,dseg
      mov ds,ax

      lea dx,Msg1
      mov ah,09h
      int 21h

      mov ah,1
      int 21h
      cmp al,'a'
      jb Exit
      cmp al,'z'
      ja Exit

      sub al,20h
      mov Result,al

      lea dx,Msg2
      mov ah,9
      int 21h
    Exit: mov ah,4ch
      int 21h
    cseg ends
      end Start
    我遇到的问题是:编译连接成功后,生成exe文件,执行exe文件时,我实际操作的时候就是已输入键盘字母,它就退出了,很诡异;
    我用debug跟踪了,跟踪的时候执行到
    lea dx,Msg1
      mov ah,09h
      int 21h
    完了以后程序就乱了 ,也就是说下面的程序通通没有执行,但是我
    不清楚这里怎么会跳转?

    注意:在跟踪调试时,如果遇到int 21h,不能按t,而要按p,ok,问题解决了。

  • 相关阅读:
    python 代码片段8
    python 代码片段7
    python 代码片段6
    python 代码片段5
    python 代码片段4
    django 代码片段3
    python 代码片段2
    Redis事物
    Redis的java客户端jedis
    Redis五大数据类型
  • 原文地址:https://www.cnblogs.com/javaadu/p/11742816.html
Copyright © 2011-2022 走看看