A antoni1 New Member Jan 28, 2005 #1 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?
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?
Exo Active Member Jan 29, 2005 #3 Most C compiler allow the use of inline assembly... what compiler do you use ?
T TwinTurboLs1 New Member Jan 29, 2005 #4 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? Click to expand... I could make it into C if it was really important, it takes me a while though.
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? Click to expand... I could make it into C if it was really important, it takes me a while though.