Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

asm to C

Status
Not open for further replies.

antoni1

New Member
milliDelay
movlw .250 ;outer loop
addlw 0xFF ;inner loop
btfss STATUS,Z
goto $-2 ;goto inner loop

movlw 1 ;16-bit decrement
subwf ARG1L,f
btfss STATUS,C
decf ARG1H,f

movf ARG1H,f ;16-bit test if zero
btfsc STATUS,Z
movf ARG1L,f
btfsc STATUS,Z
return
goto milliDelay

CAN anyone help me to translate this assemply code into C language?
 
Most C compiler allow the use of inline assembly...
what compiler do you use ?
 
antoni1 said:
milliDelay
movlw .250 ;outer loop
addlw 0xFF ;inner loop
btfss STATUS,Z
goto $-2 ;goto inner loop

movlw 1 ;16-bit decrement
subwf ARG1L,f
btfss STATUS,C
decf ARG1H,f

movf ARG1H,f ;16-bit test if zero
btfsc STATUS,Z
movf ARG1L,f
btfsc STATUS,Z
return
goto milliDelay

CAN anyone help me to translate this assemply code into C language?

I could make it into C if it was really important, it takes me a while though.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top