汇编串操作程序设计 计算(X+(Y*Z-100))/W
程序员文章站
2024-02-01 19:06:04
...
串操作程序设计
本文由黑龙江大学2017级提供
(有用记得点赞呦)
计算 (X+(Y*Z-100))/W
其中:X, Y, Z, 均为十六位有符号数,其存储形式如下,
X DW -13
Y DW 30
Z DW 24
W DW 50
DATAS SEGMENT
STRBUF DB 10 DUP(?)
DATAS ENDS
STACKS SEGMENT
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV CX,10
MOV DI,0
REST: MOV AH,01H
INT 21H
MOV STRBUF[DI],AL
INC DI
LOOP REST
MOV CX,10
MOV AL,'&'
MOV DI,0
CONT: CMP AL,STRBUF[DI]
JNZ NEXT
MOV STRBUF[DI],' '
MOV DH,0
mov ax,DI
mov dh,ax
ADD DH,49
NEXT: INC DI
LOOP CONT
MOV CX,10
MOV DI,0
AGAIN:MOV DL,STRBUF[DI]
MOV AH,02H
INT 21H
INC DI
LOOP AGAIN
MOV AH,02H
MOV DL,DH
INT 21H
MOV AH,4CH
INT 21H
CODES ENDS
END START
上一篇: web
下一篇: Mac OS X汇编语言常识