Hi, I'm going a bit of topic here but I'll remain within PIC domain trust me.= I don't have an answer for your exact question but instead some minor questions. =46rom your code posting: ;divide by powers of 10 to get one decimal character at a time MOVFF RCREG,AARGB0 ;move limit into dividend registe= r MOVLW 0x64 ;100d MOVWF BARGB0 ;move to divisor register CALL FXD0808U ;unsigned 8x8 division MOVLW 0x16 ;load high byte of PC for table lookup vector MOVWF PCLATH ;program counter latch high MOVF AARGB0,W ;move quotient to wreg for code lookup CALL ASC_TBL ;lookup hex code for ascii charac= ter MOVWF CHARIN ;move value to character holding register CALL SERDISP ;display character MOVFF REMB0,AARGB0 ;move remainder to use as next divisor MOVLW 0x0A ;10d MOVWF BARGB0 ;move to divisor register CALL FXD0808U ;unsigned 8x8 division MOVLW 0x16 ;load high byte of PC for table lookup vector MOVWF PCLATH ;program counter latch high MOVF AARGB0,W ;move quotient to wreg for code lookup CALL ASC_TBL ;lookup hex code for ascii charac= ter MOVWF CHARIN ;move value to character holding register CALL SERDISP ;display character MOVLW 0x16 ;load high byte of PC for table lookup vector MOVWF PCLATH ;program counter latch high MOVF REMB0,W ;move remainder to wreg for code lookup CALL ASC_TBL ;lookup hex code for ascii charac= ter MOVWF CHARIN ;move value to character holding register CALL SERDISP ;display character All this for translating an recevied byte to ascii represenatation ?? I'm very curious how many program cycles there are in this snippet, can you measure it ? ( either simulate or place breaks at entry/exit and check number of cycles in between ). Anyway I would propose something like this instead: ;------------------------------------------- ;Fast binary to decimal conversion (0..255) ; ;Input: in W ;Temp: AARGB0 ;Output one digit at a time, seq. Hund:Tens:Ones (real ASCII) ; pseudo routine SERDISP used for byte output = ; ; ; ;Size: ? instructions ;Execution time (with return): ? ; ;25-January-2001 by Tony K=FCbek ****untested**** ; ; Stripped (limited to 8-bit input, no digit ram) version of : ; http://www.piclist.com/techref/microchip/math/radix/b2a-16b3a2-ng.htm ; as per: ;8-July-2000 by Nikolai Golovchenko ;23-Aug-2001 ;Based on 8bit BIN2BCD of Scott Dattalo ;------------------------------------------- #define BYTE_OFFSET 0x30 ; start decimal ASCII numbers bin2dec255fast movwf AARGB0 ; save number swapf AARGB0, w ;Add the upper and lower nibbles addwf AARGB0, w ;to get the one's digit andlw 0x0F skpndc ;Go through a binary to bcd addlw 0x16 ;conversion for just the one's skpndc ;digit addlw 0x06 addlw 0x06 skpdc addlw -0x06 btfsc AARGB0, 4 ;bit 4 is a special case addlw 0x16 - 1 + 0x6 skpdc addlw -0x06 ;now adjust the ten's digit btfsc AARGB0, 5 ;2^5 =3D 32, so add 3 to the ten's addlw 0x30 ;digit if bit 5 is set btfsc AARGB0, 6 ;2^6 =3D 64, so add 6 addlw 0x60 ;if bit 6 is set btfsc AARGB0, 7 ;2^7 =3D 128, so add 2 (the ten's addlw 0x20 ;digit) if bit 7 is set addlw 0x60 ;convert the ten's digit to bcd = ;if there's a carry, then the input skpc ;was greater than 99. goto between_0_199 between_100_255 ; number greater than 100 addlw -0x60 ; rotate top bit of input into carry to see if number is above 20= 0 rlcf AARGB0,F movwf AARGB0 ; save tens and ones ( packed bcd ) ; if carry set send hundred digit '2' else '1' movlw 0x31 skpnc movlw 0x32 ; and display the hundred digit CALL SERDISP ;display character in w goto send_tens_ones between_0_199 ; number less than 200, hundred can only be '0' or '1' rlcf AARGB0,F ; save top bit into carry movwf AARGB0 ; save tens and ones ( packed bcd ) movlw 0x30 = skpnc movlw 0x31 ; and display the hundred digit CALL SERDISP ;display character in w send_tens_ones ; prepare tens digit swapf AARGB0,w = andlw 0x0f ; strip top nibble addlw BYTE_OFFSET ; make ascii ; and display the tens digit CALL SERDISP ;display character in w ; prepare ones digit movf AARGB0,w = andlw 0x0f addlw BYTE_OFFSET ; make ascii ; and display the ones digit CALL SERDISP ;display character in w ; done return = Perhaps some minor modifications are needed. Optimisations can be plentiful, in particular if more ram are available. /Tony -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body