want c code for asm BIL.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

want c code for asm BIL.

2,266 Views
eexpress
Contributor I
within Manual_Compiler_HC08.pdf, i can found some C code format of special flags, such as __isflag_carry(), but the manual has some error, BIL BIH does not present correctlly C code here. how can i do. for when i use :

asm BIL TTT;
....
TTT: some C code

i got an compiler error, "label TTT not set".
but if i change to this:

if(__isflag_carry()) goto TTT;
....
TTT: some C code

complier passed.
Labels (1)
0 Kudos
3 Replies

476 Views
CrasyCat
Specialist III

Hello

I have performed some test with CodeWarrior for HC08 V5.1.

Following ANSI C source code
    if (__isflag_int()) {
generates 
  0002 2e08     [3]             BIL   LC ;abs = 000c

Following ANSI C code
if (!__isflag_int()) {
generates
  000c 2f08     [3]             BIH   L16 ;abs = 0016

Which is what you have been looking for.

Am I missing something?

CrasyCat

0 Kudos

476 Views
Sten
Contributor IV

I did test only with CW for S12, but it seems that you can't use a C-label in asm. This means that you have to write the code as follows:

asm BIL TTT;
... some C- or asm-source
asm TTT:
... some C-source

0 Kudos

476 Views
eexpress
Contributor I
thanks all.
i had solved this. for i had download an new pdf manual of compiler. and find "__isflag_int" here(the old manual here has some mistaken). and i also had test "asm tt:", find the label also need an "asm" before it.

thanks, CrasyCat & Sten. and your pretty kid and elephant pictrue is so good. :smileyvery-happy:
0 Kudos