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

C coding for C8051F340

Dear Sir,
This is my coding. I want to write it in C language. I'm a very begginer. How can i write DB "DWIN" instruction in C language. Please Guide me. thank you for your help.

ORG 1FFCH
DB "DWIN"
START: MOV DPTR,#0044H
MOVX A,@DPTR
JNZ START
INC DPL
MOVX A,@DPTR
JNZ START
MOV A,#LOW(500)
MOVX @DPTR,A
DEC DPL
MOV A,#HIGH(500)
MOVX @DPTR,A
MOV DPTR,#0042H
MOVX A,@DPTR
XRL A,#01H
MOVX @DPTR,A
LJMP START

Thanks & Regards,
Saravanaeswaran.M

Parents Reply Children
  • "Note that the 'C' code posted will not assure this..."

    Exactly - C isn't designed with the intention that it should be possible for the developer to place a magic marker first in the binary using C.

    If needed, this is normally done by linking the binary 4 bytes into the memory range, and then use some post-processing step to merge marker + generated binary.