.pg .x divq .lt ------------------------------------------------------------------------ DIVQ divisor,divident,quotient,remainder ------------------------------------------------------------------------ .el .b 3 This macro performs quadword division. .b This macro will produce inline code to perform the quadword division. After the division is performed, r0 will contain the following values: .b .lt -1 if quotient < 0 0 if quotient = 0 1 if quotient > 0 .el .b The DIVQ4 macro is equivalent to the expression: .b .lt (quoitent,remainder) = divisor / dividend .el .b For example: .b .lt divq4 divisor,divident,quotient,remainder .el .b will generate the following code: .b .lt pushr #^M movq divisor,r0 movq divident,r2 movq r2,r4 clrq r6 clrl r8 movl #65,r10 30001$: ashq #1,r6,r6 bisl r8,r6 clrl r8 cmpl r1,r7 bneq 30002$ cmpl r0,r6 30002$: bgtru 30003$ subl r0,r6 sbcw r1,r7 incl r8 30003$: clrl r9 tstl r5 bgeq 30004$ incl r9 30004$: ashq #1,r4,r4 bisl r8,r4 movl r9,r8 decl r10 bneq 30001$ movq r4,quotient movq r6,remainder popr #^M tstl 4+quotient blss 30005$ bgtr 30006$ tstl quotient bnequ 30006$ clrl r0 brb 30007$ 30005$: movl #-1,r0 brb 30007$ 30006$: movl #1,r0 30007$: .el .b See also ADDQ, ADDQ3, CMPQ, MULQ, MULQ3, SUBQ, SUBQ3 and TSTQ.