⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 huiwen2.asm

📁 输入一段英文字母
💻 ASM
字号:
datarea segment                 ;define datarea segment
 array db 40 dup(?)               ;define the array's max length is 40
 out1  db " yes!$"               ;when the string is huiwen,out yes
 out2  db " no!$"                ;else out no
datarea ends                    
prognam segment                    ;define prognam segment
 assume cs:prognam,ds:datarea
main proc far                        ;main part of prognam
start:                            ;starting execution address
    push ds                       ;save old data segment
    sub ax,ax                   ;put zero in ax
    push ax                   ;save it on stack
    mov ax,datarea              ;datarea segment addr
    mov ds,ax                    ;into ds register
    mov cx,0                    ;put zero in cx
    mov si,0                   ;put zero in si
    mov di,0                    ;put zero in di 
in1:
    mov ah,01h                  ;move a parameter from keybd
    int 21h
    cmp al,20h                ;juge the zifu is space
    jz  exit1                 ;if it is space ,then exit
    inc cx                     ;else increnment cx
    mov array[si],al           ;put al in array
    inc si                     ;then increnment si
    jmp in1                    ;jump into in1,continue the enter
exit1:
    mov bl,array[si-1]           ;compare the last zifu 
    cmp bl,array[di]            ;and the first
    jnz exit                        ;if the zifu is not equiped then exit 
    dec si                          ;else continue
    inc di
    loop exit1
    lea dx,out1
    mov ah,09h
    int 21h
    ret
exit:
    lea dx,out2
    mov ah,09h
    int 21h
    ret
main endp
prognam ends
     end start
main endp
prognam ends
     end start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -