编程实现以下运算:
①S1=1+2+3+4+…+98+99+100
②S2=1+3+5+7+9+…+99
①CODE SEGMENT
ASSUME CS:CODE
START: MOV CX,100
MOV AX,0
MOV BX,1
LP: ADD AX,BX
INC BX
LOOP LP
;此时AX中即为1+2+…+100的值
︰
CODE ENDS
END START
②CODE SEGMENT
ASSUME CS:CODE
START: MOV AX,0
MOV BX,1
LP: CMP BX,100
JAE DONE
ADD AX,BX
INC BX
INC BX
JMP LP
DONE: ;此时AX中已经是100以内所有奇数之和