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
  • Wrong approach.

    There isn't any 1:1 relationship between C and assembler, so don't try to translate individual assembler statements.

    Figure out exactly what the assembler code does, and then figure out what C constructs you would need to get a similar result.

Reply
  • Wrong approach.

    There isn't any 1:1 relationship between C and assembler, so don't try to translate individual assembler statements.

    Figure out exactly what the assembler code does, and then figure out what C constructs you would need to get a similar result.

Children