串操作程序设计 HLJU
计算 (X+(Y*Z-100))/W 其中:X, Y, Z, 均为十六位有符号数,其存储形式如下, X DW -13 Y DW 30 Z DW 24 W DW 50
代码语言:javascript
复制
DATAS SEGMENT STRBUF DB 10 DUP(?) DATAS ENDS
STACKS SEGMENT
STACKS ENDSCODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AXMOV CX,10 MOV DI,0
REST: MOV AH,01H
INT 21H
MOV STRBUF[DI],AL
INC DI
LOOP RESTMOV CX,10 MOV AL,'&' MOV DI,0
CONT: CMP AL,STRBUF[DI]
JNZ NEXTMOV STRBUF[DI],' ' MOV DH,0 mov ax,DI mov dh,ax ADD DH,49
NEXT: INC DI
LOOP CONTMOV CX,10 MOV DI,0
AGAIN:MOV DL,STRBUF[DI]
MOV AH,02H
INT 21H
INC DI
LOOP AGAINMOV AH,02H MOV DL,DH INT 21H MOV AH,4CH INT 21H
CODES ENDS
END START