; algorithme de division avec un dividende positif ou négatif ; ; testé avec -14 / 3 ; LDA dividend,d BRGE positif1 NEGA LDX -1,i STX signe,d positif1:LDX 0,i ; quotient soustrai:ADDX 1,i SUBA diviseur,d BRGE soustrai SUBX 1,i ; défaisons la dernière soustraction ADDA diviseur,d STA reste,d LDA signe,d BREQ positif2 NEGX ; rendre négatif le quotient LDA reste,d NEGA ; rendre négatif le reste STA reste,d positif2:STX quotient,d DECO quotient,d CHARO ' ',i DECO reste,d STOP dividend:.WORD -14 diviseur:.WORD 3 quotient:.BLOCK 2 ; #2d reste: .BLOCK 2 ; #2d signe: .BLOCK 2 ; #2d (0-positif ou -1:négatif) .END