汇编作业
/*设在DAT1,DAT2字单元中存放一双字长年有符号数,编一程序完成将该双字长的绝对值送ABS1和ABS2字存储单元。*/
DATA SEGMENT
DAT1 DW -1213H
DAT2 DW -7000H
ABS1 DW ?
ABS2 DW ?
DATA ENDS
STACK SEGMENT STACK
DB 200 DUP (0)
STACK ENDS
CODE SEGMENT
ASSUME DS:DATA,SS:STACK,CS:CODE
START: MOV AX,DATA
MOV DS,AX
MOV DX,DAT1
CMP DX,0
JGE FLAG1
NEG DX
FLAG1: MOV ABS1,DX
MOV CX ,DAT2
CMP CX,0
JGE FLAG2
AND CX,7FFFH
NEG CX
FLAG2: MOV ABS2,CX
MOV AH,4CH
INT 21H
CODE ENDS
END START
阅读(1200) | 评论(0) | 转发(0) |