能否请高手大哥 给我排除下错误!(关于工资查询的)
Person STRUCTName DB '********************' ;20个字符
Time DB 4 DUP(?)
Effic DB 4 DUP(?)
Wage DB 8 DUP(?)
Person ENDS
DATA SEGMENT
String1 DB 'Please input Name:','$'
String2 DB 'Error!Again input Name:','$'
Stirng3 DB 'Please input Time:','$'
String4 DB 'Please input Effic:','$'
String3 DB 'Name Time Effic Wage ',0DH,0AH,'$'
Buf0 DB 21
DB ?
DB 20 DUP(?)
Buf1 DB 20 DUP(?)
Buf2 DB 8 DUP(?)
Buf3 DB ?
Buf4 DW ?
P1 Person {}
P2 Person {}
P3 Person {}
P4 Person {}
P5 Person {}
P6 Person {}
P7 Person {}
P8 Person {}
P9 Person {}
P10 Person {}
P11 Person {}
P12 Person {}
P13 Person {}
P14 Person {}
P15 Person {}
P16 Person {}
P17 Person {}
P18 Person {}
P19 Person {}
P20 Person {}
P21 Person {}
P22 Person {}
P23 Person {}
P24 Person {}
P25 Person {}
P26 Person {}
P27 Person {}
P28 Person {}
P29 Person {}
P30 Person {}
P31 Person {}
P32 Person {}
P33 Person {}
P34 Person {}
P35 Person {}
P36 Person {}
P37 Person {}
P38 Person {}
P39 Person {}
P40 Person {}
P41 Person {}
P42 Person {}
P43 Person {}
P44 Person {}
P45 Person {}
P46 Person {}
P47 Person {}
P48 Person {}
P49 Person {}
P50 Person {}
DATA ENDS
STACK SEGMENT PARA STACK 'STACK'
DB 100 DUP(?)
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA,SS:STACK
MAIN PROC FAR ;主程序开始B
START: MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV AX,STACK
MOV SS,AX
MOV AH,06H ;清屏
MOV BL,14H
MOV AL,00H
MOV CX,0000H
MOV DX,184FH
INT 10H
MOV DX,OFFSET String1;显示提示信息"Please inputName:"
MOV AH,09H
INT 21H
AGAIN: MOV DX,OFFSET Buf0 ;从键盘读入一个人名
MOV AH,0AH
INT 21H
MOV AL,00H ;搜索人名
MOV CX,50
A1: MOV BX,P1
ADD BX,AL
MOV SI,BX
PUSH CX
PUSH SI
CLD
A2: MOV CX,Buf0+1
MOV DI,Buf0+2
REPE CMPSB
JZ FOUND
POP SI
POP CX
MOV AL,24
LOOP A1
MOV DX,OFFSET String2 ;显示输入错误信息,要求重新输入
MOV AH,09H ;"Error!Again input Name:"
INT 21H
JMP AGAIN
FOUND: MOV DX,OFFSET String3
;显示表头Name Time Effic Wage
MOV AH,09H
INT 21H
MOV Buf1,[SI-20] ;显示人名
MOV DX,OFFSET Buf1
MOV AH,09H
INT 21H
MOV AL,[SI] ;将时间转换为ASCII码
CBW
CALL SWITH
CALL DISP ;显示时间
MOV AL,[SI+1] ;将工资率转换为ASCII码
CBW
CALL SWITH
CALL DISP ;显示工资率
CALL MULTD ;计算工资总额
CALL SWITH ;将工资总额转换为ASCII码
CALL DISP ;显示工资总额
MOV AH,4CH
INT 21H
RET
MAIN ENDP ;主程序结束
SWITH PROC NEAR
MOV CX,0004H
MOV DI,Buf1
MOV DX,[DI]
A1: MOV AX,DX
AND AX,000FH ;取低四位值
Cmp AL 0AH ;判断是否小于9
JB A2 ;若在0~9范围内,则转A2
ADD AL,07H ;若为"A~F范围内,加上7
A2: ADD AL,30H ;转换为ASCII码
MOV Buf2,AL
INC DI
PUSH CX ;保护循环计数器的内容
MOV CL,04H ;位移次数送至CL
SHR DX,CL
POP CX
LOOP A1
RET
SWITH ENDP
DISP PROC NEAR
SLD
MOV SI,Buf1
MOV CX,$-Buf1
MOV AL,[SI]
CMP AL,0
JZ D1
JMP A2
A2: SLD
MOV AL,[SI]
MOV AH,02H
INT 21H
LOOP A2
RET
DISP ENDP
MULTD PROC NEAR
LEA DI,BUF1+6
MOV SI,BX
ADD SI,3
PUSH SI
MOV CX,4
MOV BYTE PTR [DI]
MOV BX,OFFSET Time
CALL MD1
MOV CX,5
MOV DI,OFFSET Effic+6
MOV SI,OFFSET BUF1+6
CALL MD2
LEA DI,BUF1+5
POP SI
MOV CX,4
MOV BYTE PTR[DI],0
DEC BX
CALL MD1
MOV CX,5
MOV DI,OFFSET Effic
MOV SI,OFFSET BUF1+5
CALL MD2
RET
MULTD ENDP
MD1 PROC NEAR
STD
CYCLE:LODSB
AND AL,0FH
MUL BYTE PTR[BX]
AAM
ADC AL,[DI]
AAA
STOSB
MOV [DI],AH
LOOP CYCLE
RET
MD1 ENDP
MD2 PROC NEAR
CLC
LP0: MOV AL,[SI]
ADC AL,[DI]
AAA
MOV [DI],AL
DEC SI
DEC DI
LOOP LP0
ADC BYTE PTR[DI]
RET
MD2 ENDP --------------------编程问答-------------------- 不懂也要帮楼主顶顶 --------------------编程问答-------------------- 看了半天,没看出错呀,帮顶。 --------------------编程问答-------------------- 楼主是搞 COBAL开发的 对吗 ?
有兴趣的话可以问问旁边的老美,专业的老师 --------------------编程问答-------------------- 汇编?真迷糊..还是不看了..去上课了.闪人! --------------------编程问答-------------------- 不会,帮顶 --------------------编程问答--------------------
补充:.NET技术 , 其他语言