+ -
当前位置:首页 → 问答吧 → 求助

求助

时间:2011-11-12

来源:互联网

小小
不知我的檢查的地方條件哪裡錯了
一直進不了PROC裡
Assembly code

TITLE MASM Template                        (main.asm)

; Description:
; 
; Revision date:

INCLUDE Irvine32.inc
.data
msg1 byte "input data: ",0
buffer byte 34 DUP('0')
bytecount dword ?

.code
main PROC
    call Clrscr
    .REPEAT
    
        mov edx,offset msg1
        call WriteString
    
        mov edx,offset buffer
        mov ecx,sizeof buffer
        call ReadString
        mov bytecount,eax
        mov eax,0
    
        mov ebx,bytecount
        
        .IF buffer[ebx] =='H'
        mov esi,0
        call Check
        .ELSEIF buffer[ebx] =='h'
        mov esi,0
        call Check
        .ELSE
            jmp QUIT
        .ENDIF
    
    .UNTIL eax=='*'
    
    QUIT:
    mov eax,'*' ;to stop
    
    exit
main ENDP
Check PROC USES esi eax
.WHILE esi < bytecount
    mov al,buffer[esi]
    .IF al == '1'
    inc esi
    .ELSEIF al == '2'
    inc esi
    .ELSEIF al == '3'
    inc esi
    .ELSEIF al == '4'
    inc esi
    .ELSEIF al == '5'
    inc esi
    .ELSEIF al == '6'
    inc esi
    .ELSEIF al == '7'
    inc esi
    .ELSEIF al == '8'
    inc esi
    .ELSEIF al == '9'
    inc esi
    .ELSEIF al == 'A'
    inc esi
    .ELSEIF al == 'B'
    inc esi
    .ELSEIF al == 'C'
    inc esi
    .ELSEIF al == 'D'
    inc esi
    .ELSEIF al == 'E'
    inc esi
    .ELSEIF al == 'F'
    inc esi
    .ELSE
        mov al,'*'
        .BREAK
    .ENDIF
.ENDW
ret
Check ENDP
END main

謝謝

作者: peggy0135   发布时间: 2011-11-12

你是说进不了 Check

作者: mydo   发布时间: 2011-11-15