----- Original Message ----- From: "Roberts II, Charles K." To: "Microcontroller discussion list - Public." Sent: Monday, April 25, 2005 2:44 PM Subject: [PIC] 32 bit by 16 bit by 16 bit division routine, what am I doing wrong? > > > >>div16by16 >>BANK1 >>clrf x_2 ;clear >>clrf x_3 ;remainder > >>div16by16loopinit >>clrf tempa ;clear remainder extension >>movlw 0x10 >>movwf counter >>BSF STATUS,C ;first iteration will be subtraction > > This was originally the SETC command, I didn't find it in the 16F873A > instruction set summary. I just remembered that you can not set the > Carry bit directly. I have changed it to > > MOVLW 0xFF > ADDLW 0x01 > > which would set my carry bit. A bit of progress I guess. > > Chuck You certainly CAN set the carry directly. This can be done with either the 'SETC' macro, or via the BSF STATUS,C instruction. You're problem is something else! Have you included the appropriate processor specific include file? Bob Ammerman RAm Systems -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist