As PCM said "\%4x" is for 8 bit. Try \%4lx".... You are truncating to the two least significant hex digits and adding two leading zeros since you specify four decimal places.... This is not ANSI standard C.

Yes, I mean PCM. I though the L portion of \%Lx is the length I would like to specify; as in the example.

\%4X 0012 00FE

:=:=I have a quick question in regards to multiplication. I don't seem to be able to multiply/add anything greater than 8bits.
:=:=
:=:=I have the PCH compiler version 3.086 for a PIC16F877.
:=
:=You mean the PCM compiler.
:=
:=:=
:=:=temp_window = 1*256;
:=:=printf( "\%4x", temp_window );
:=
:=In CCS, you have to use "lx" for a 16-bit or 32-bit number.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10665

DerekGuest

Re: 16-bits multiplication/adition problem?

Posted: Mon Jan 13, 2003 3:57 pm

Oh, I got it to work. Thanks guys. All this time, I thought it was some sort of type casting problem and it drove me nuts.