【任务】
补全下面的程序,其功能是计算y的值
汇编程序:计算分段函数_汇编程序

assume cs:code,ds:data
data  segment
   x db  45h
   y db  ?
data  ends
code  segment
start:mov ax,data
      mov ds,ax
      mov al,x
      ……
      ……
over: mov y,bl
      mov ah,4ch
      int 21h
code  ends
      end  start

【参考解答】

assume cs:code,ds:data
data  segment
   x db  45h
   y db  ?
data  ends

code  segment
start:mov ax,data
      mov ds,ax
      mov al,x
      cmp al,0
      jge next1
      mov bl,-1
      jmp over
next1:cmp al,0
      je  next2
      mov bl,1
      jmp over
next2:mov bl,0
over: mov y,bl
      mov ah,4ch
      int 21h
code  ends
      end  start