This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

using labels

I am a computer engineering student using Microvison2. I am trying to create a small program that uses an sjmp loop comand but I don't know how to make labels in the software. Any help would be greatly appreciated.

Parents
  • Ahhh, so you are trying to embed some assembly language in a C program. (Hint, supply more information in future).

    I haven't tried it in the Keil C, but this works in Borland C:
    =======================
    asm mov P1,#10010011

    loop:

    asm mov c, P1.0
    asm cpl c
    asm andl c, P1.1
    asm orl c, P1.7
    asm mov P1.4, c
    asm sjmp loop
    =======================
    i.e. the label is just a C statement, it is not ASM'ed.

Reply
  • Ahhh, so you are trying to embed some assembly language in a C program. (Hint, supply more information in future).

    I haven't tried it in the Keil C, but this works in Borland C:
    =======================
    asm mov P1,#10010011

    loop:

    asm mov c, P1.0
    asm cpl c
    asm andl c, P1.1
    asm orl c, P1.7
    asm mov P1.4, c
    asm sjmp loop
    =======================
    i.e. the label is just a C statement, it is not ASM'ed.

Children
  • I am not trying to embed it in a C program. What you saw was pretty much all my code. My teacher wants us to write a program in-line (he didn't show us any other way) That is why I am having so much trouble. I know of another assembly program. He said he wants the listing file and the hex file. I know of a unix compiler that I can use. I need to play with microvision some more and hopefully figure out how to bypass the in-line compiler. By the way

    loop:

    as a command is not valid.

    I would really like to thank you for all the help you guys have provided me.

  • "My teacher wants us to write a program in-line (he didn't show us any other way)"<br>
    <br>
    Talk to him!