# This is project one .lcomm dividend 2 .lcomm divisor 2 .lcomm quotient 2 .text .global _start _start: # given dividend and divisor # need to compute quotient # quotient = 0 movw $0, quotient # we need to move divisor to a reg # because we cannot compare mem to # mem movw divisor, %ax # while dividend >= divisor do checkPrecondition: cmpw %ax, dividend jc exitLoop # dividend -= divisor subw %ax, dividend # quotient += 1 addw $1, quotient # end while jmp checkPrecondition exitLoop: movl $1, %eax int $0x80