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

Use MACRO C "#define value" in MACRO ASM

I use KeilC uVision4 for 89C51 MCU.
I use "Inline ASM Code", like this :

    void main() {
        #pragma ASM
            MOV R7, #(80000/40000)
        #pragma ENDASM
    }


-> When COMPILE, ASM result file give a wrong value to R7

        MOV R7, #0x00


But when i change like this :

    void main() {
        #pragma ASM
            MOV R7, #(60000/30000)
        #pragma ENDASM
    }


-> The COMPILER give correct value to R7

        MOV R7, #0x02


=> Seem, there must be a restriction when the ASM Compiler calculate (80000/40000) ?
=> And is there any way to pass this restriction. Please help me !
Regards !