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

last line always syntax error

I wanted to write a programs about traffic light,but the last line aiways say syntax error.
Help >> about µVision is display:

IDE-Version:
µVision V5.14.2
Copyright (C) 2015 ARM Ltd and ARM Germany GmbH. All rights reserved.

License Information:
156 186
561
LIC=----

Tool Version Numbers:
Toolchain: PK51 Prof. Develpers Kit Version: 9.54
Toolchain Path: C:\Users\PC39\Desktop\C51\BIN
C Compiler: C51.exe V9.54
Assembler: A51.exe V8.02c
Linker/Locator: BL51.exe V6.22
Librarian: LIB51.exe V4.30.1.0
Hex Converter: OH51.exe V2.7.0.0
CPU DLL: S8051.DLL V3.100.0.0
Dialog DLL: DP51.DLL V2.62.0.1

can you help me?

Parents Reply Children
  • I am sorry I do not understand what you mean.
    Will I post the error message to you?

  • The compiler says your code is broken, so you show me the version of the compiler/IDE, think about how that's going to help understand what is wrong with YOUR code.

  • If you want help with a compilation error message, then you would obviously have to supply the actual error message. And most likely you would also need to supply us with the relevant source code the error message is relating to since syntax errors relates to source code syntax - and we can't guess what your code looks like...

  • /*-------------------------------------------------- ç³»çµ±é˜æŽ§è¨ˆæ™‚ä¸­æ–·æœå‹™å¸¸å¼
    --------------------------------------------------*/
    #include <reg51.h>
    #include "system.h"
    #include "tick.h"
    #include "keypad.h"

    #define TICK_INTERRUPT_PERIOD_CNT (((XTAL*TICK_INTERRUPT_PERIOD_MS)/1000)/12)

  • /*-------------------------------------------------- ç³»çµ±é˜æŽ§è¨ˆæ™‚ä¸­æ–·æœå‹™å¸¸å¼
    --------------------------------------------------*/
    #include <reg51.h>
    #include "system.h"
    #include "tick.h"
    #include "keypad.h"

    #define TICK_INTERRUPT_PERIOD_CNT (((XTAL*TICK_INTERRUPT_PERIOD_MS)/1000)/12)
    /********************************************************* MICRO_ADJUST = 計時器中斷時間準確度微調,如中斷誤差,單ä½=指令時間,值減少則調慢(中斷週期時間調長)

    *********************************************************/
    #define MICRO_ADJUST 22 //é˜æŽ§è¨ˆæ™‚æº–ç¢ºåº¦å¾®èª¿
    #define TICK_PERIOD ((65536-TICK_INTERRUPT_PERIOD_CNT)+MICRO_ADJUST)
    unsigned int SystemTick; //ç³»çµ±é˜æŽ§è¨ˆæ™‚å€¼
    unsigned int RetTick; //ç³»çµ±é˜æŽ§è¨ˆæ™‚å›žå‚³å€¼

    /*========================================================
    讀å–ç³»çµ±é˜æŽ§è¨ˆæ™‚å€¼
    ========================================================*/
    unsigned int GetSystemTick(void)
    { #pragma asm
    /* 抓å–ç³»çµ±é˜æŽ§å€¼ */ MOV A,SystemTick+01H MOV RetTick+01H,A MOV A,SystemTick
    MOV RetTick,A /* æ¯”è¼ƒç³»çµ±é˜æŽ§å€¼æœ‰ç„¡è®ŠåŒ– */ MOV A,SystemTick+01H CJNE A,RetTick+01H,DiffByInterrupt MOV A,SystemTick CJNE A,RetTick,DiffByInterrupt /* ç³»çµ±é˜æŽ§å€¼æœ‰ç„¡è®ŠåŒ– */ JMP GtRet /* ç³»çµ±é˜æŽ§å€¼æœ‰å› ä¸­æ–·è€Œè®ŠåŒ–ï¼Œé‡æ–°æŠ“å–ç³»çµ±é˜æŽ§å€¼ */
    DiffByInterrupt MOV A,SystemTick+01H:
    MOV RetTick+01H,A
    MOV A,SystemTick
    MOV RetTick,A
    GtRet #pragma endasm: return(RetTick); /* å‚³å›žç³»çµ±é˜æŽ§å€¼ */
    }

  • oh no I'm sorry i can post Chinese word in there.
    there are Chinese word in my Program....
    How can i do....

  • well, how about posting the error message, not just "I get an error message"?

  • Post your code between PRE tags as described in the posting instructions, or post the code on PasteBin or something similar.