;分段函数计算 DATAS SEGMENT X db -1 Y db 3 F db ? DATAS ends CODES SEGMENT ASSUME CS:CODES, DS:DATAS START: mov AX,DATAS mov DS,AX mov ah,x mov al,y cmp ah,1 jl r1 cmp al,1 jl r1 ;x小于1或y小于1均跳转 cmp ah,5 ja r3 ; cmp al,5 ja r3 ;x或y大于5 jmp r2 ;x或y属于[1,5] r1: mov f,-1 jmp exit r2: mov f,0 jmp exit r3: mov f,1 jmp exit exit: mov ah,4ch int 21H CODES ends end START