首先,很抱歉代码块很长,但是我不知道错误在哪里,我已经寻找了过去的2个小时,假设我还在学习语言,我确实删除子例程的内容,因为错误仍然发生在没有代码的情况下。
正如标题所述,我遇到了错误A1010:不匹配的块嵌套: main
根据我从研究这个问题中收集到的信息,我不应该遇到这个问题,所以我求助于专家……SOS
INCLUDE Irvine32.inc
.data
buffersize equ 41
bytecount dword ?
buffer byte buffersize dup(0)
null equ 0
tab equ 9
stacksize equ 8
stackindex sdword -4
numstack sdword stacksize dup(0)
.code
main PROC
MLOOP:
;whitespace skipping to recieve useable input
MOV EDX, offset buffer ;read from command line
MOV ECX, sizeof buffer
CALL ReadString
MOV bytecount, EAX ;keep the byte count
MOV EDI, 0 ;init the index register to 0
SKIP:
CMP EDI, bytecount ;test for eol
JGE ENDLOOP ;nothing in buffer to process
MOV AL, buffer[EDI] ;get char at buffer location EDI for testing
CMP AL, NULL ;test if the char is null
JE ENDLOOP ;nothing in buffer to process
CMP AL, ' ' ;test for a space
JE NEXTCHAR ;skips the space
CMP AL, TAB ;test for a tab
JNE ENDSKIP ;process the command
NEXTCHAR:
INC EDI ;updates the index for the next char
JMP SKIP
ENDLOOP:
MOV AL, -1 ;nothing in buffer, identified by setting AL to -1
ENDSKIP:
;input handling, and menu processing
SWITCH:
CMP AL, -1 ;test if we dont have anything to process
JE ENDCASE
CASE1:
CMP AL, '-' ;test if the char is a -
JNE CASE2 ;process next case if not a -
INC EDI ;move to next location in the buffer
CMP EDI, bytecount ;test if within input string
JGE CASESUB ;nothing after, - is a subtraction
MOV AL, buffer[EDI] ;get next char, and assign to register AL
CMP AL, NULL ;test for null
JE CASESUB ;nothing after, - is a subtraction
CMP AL, '0' ;test for a digit
JL CASESUB ;not a digit, then its subtraction
CMP AL, '9' ;test for a digit
JG CASESUB ;not a digit, then its subtraction
CALL NEGNUMBER ;process the negitive number
JMP ENDCASE
CASESUB:
CALL SUBTRACT ;process subtraction in subtraction subprocess
JMP ENDCASE
CASE2:
CMP AL, '+' ;test if the char is a +
JNE CASE3 ;process the next case
CALL ADDITION ;process addition
JMP ENDCASE
CASE3:
CMP AL, '*' ;test if character is a *
JNE CASE4 ;process the next case
CALL MULTIPLICATION ;process multiplication
JMP ENDCASE
CASE4:
CMP AL, '/' ;test if character is a /
JNE CASE5 ;process the next case
CALL DIVISION ;process division
JMP ENDCASE
CASE5:
CMP AL, 'x' ;test if character is a lowercase X
JE CASE5A ;process current case
CMP AL, 'X' ;test if character is a uppercase X
JNE CASE6 ;process the next case
CASE5A:
CALL EXCHANGE ;process exchanging
JMP ENDCASE
CASE6:
CMP AL, 'n' ;test if character is a lowercase N
JE CASE6A ;process current case
CMP AL, 'N' ;test if character is a uppercase N
JNE CASE7 ;process the next case
CASE6A:
CALL NEGATE ;process negating
JMP ENDCASE
CASE7:
CMP AL, 'u' ;test if character is a lowercase U
JE CASE7A ;process current case
CMP AL, 'U' ;test if character is a uppercase U
JNE CASE8 ;process the next case
CASE7A:
CALL ROLLUP ;processing rolling up
JMP ENDCASE
CASE8:
CMP AL, 'd' ;test if character is a lowercase D
JE CSAE8A ;process current case
CMP AL, 'D' ;test if character is a uppercase D
JNE CASE9 ;process next case
CASE8A:
CALL ROLLDOWN ;processing rolling down
JMP ENDCASE
CASE9:
CMP AL, 'v' ;test if character is a lowercase V
JE CASE9A ;process current case
CMP AL, 'V' ;test if character is a uppercase V
JNE CASE10 ;processing next case
CASE9A:
CALL VIEW ;processing view stack
JMP ENDCASE
CASE10:
CMP AL, 'c' ;test if character is a lowercase C
JE CASE10A ;process current case
CMP AL, 'C' ;test if character is a uppercase C
JNE CASE11 ;processing next case
CASE10A:
CALL CLEAR ;processing clear stack
JMP ENDCASE
CASE11:
CMP AL, 'q' ;test if character is a lowercase Q
JE CASE11A ;process current case
CMP AL, 'Q' ;test if character is a uppercase Q
JNE CASE12 ;processing next case
CASE11A:
END ;exits program
CASE12:
CMP AL, '0' ;test if character is less then 0
JL DEFAULT ;if less then 0 goes to default case
CMP AL, '9' ;test if character is greater then 9
JG DEFAULT ; if greater then 0 case goes to default case
CALL NUMBER ;processing number handeling
JMP ENDCASE
DEFAULT:
;MOV EDX, OFFSET invalid ;invalid command line
;CALL WriteString
;CALL Crlf
ENDCASE:
JMP MLOOP
main ENDP
NEGNUMBER PROC
NEGNUMBER ENDP
SUBTRACT PROC
SUBTRACT ENDP
ADDITION PROC
ADDITION ENDP
MULTIPLICATION PROC
MULTIPLICATION ENDP
DIVISION PROC
DIVISION ENDP
EXCHANGE PROC
EXCHANGE ENDP
NEGATE PROC
NEGATE ENDP
ROLLUP PROC
ROLLUP ENDP
ROLLDOWN PROC
ROLLDOWN ENDP
VIEW PROC
VIEW ENDP
CLEAR PROC
CLEAR ENDP
NUMBER PROC
NUMBER ENDP
END发布于 2021-03-01 04:20:27
我已经弄清楚了,看起来我只是对Irvine的一些功能理解得很差,并且不能像我认为的那样使用END进程。
https://stackoverflow.com/questions/66413048
复制相似问题