Discussion Forum

assembly funcntion

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Mohamed Rezk
Posted
11-Sep-2009 22:54 GMT
Toolset
C51
New! assembly funcntion

any one know about the error in this function that moving the stepper motor please replay to me :

NAME    A_HIGH

?PR?a_high?A_HIGH    SEGMENT CODE

        PUBLIC  a_high
        RSEG  ?PR?a_high?A_HIGH
a_high:
$mod51
delayreg data 08h
delayreg100us data 09h
delayreg1ms data 0ah
Flags1 data 20h
flg_disp0 bit Flags1.0
org 2000h
start:
mov p1,#9
call delay20us
mov p1,#5
call delay20us
mov p1,#6
call delay20us
mov p1,#10
call delay20us
jmp start
delay100us:
mov r7,#48
y1: djnz r7,y1
ret
delay200us:
mov r7,#96
y1b: djnz r7,y1b
ret
delay1ms:
mov r6,#10
y2: call delay100us
djnz r6,y2
ret
delay10ms:
mov r6,#100
y3: call delay100us
djnz r6,y3
ret
delay20ms:
mov r6,#200
y4: call delay100us
djnz r6,y4
ret
delay100ms:
mov r5,#5
y5: call delay20ms
djnz r5,y5
ret
delay500ms:
mov r5,#25
y6: call delay20ms
djnz r5,y6
ret
delay1sec:
mov r5,#50
y7: call delay20ms
djnz r5,y7
ret
delay25ms:
mov r5,#25
y8: call delay1ms
djnz r5,y8
ret
delay3ms:
mov r6,#30
y9: call delay100us
djnz r6,y9
ret
delay20us:
mov r7,#18
y10: djnz r7,y10
ret
end
Read-Only
Author
Per Westermark
Posted
11-Sep-2009 22:57 GMT
Toolset
C51
New! RE: assembly funcntion

Is there any specific reason why you did not spend a bit of time explaining exactly what problem you have?

Read-Only
Author
erik malund
Posted
12-Sep-2009 11:43 GMT
Toolset
C51
New! RE: assembly funcntion

Is there any specific reason why you did not spend a bit of time making your scribbles readable (indenting) and understandable (comments).

I will gladly look at scribbles (the above can NOT be called code) if you pay me, but to ecpect anyone to spend time to decipher scribbles FOR FREE is an INSULT!

Erik

Read-Only
Author
Mohamed Rezk
Posted
12-Sep-2009 17:43 GMT
Toolset
C51
New! RE: assembly funcntion

when i call this function in c file i have errors on ($)
and (move)

Read-Only
Author
Mohamed Rezk
Posted
12-Sep-2009 17:50 GMT
Toolset
C51
New! RE: assembly funcntion

the errors that i have in keil:

($)---> misplaced primary control

(move)--> undefined symbol

Read-Only
Author
Al Bradford
Posted
12-Sep-2009 18:35 GMT
Toolset
C51
New! RE: assembly funcntion

$mod51
Look at your assembler manual. Where does this belong?
Bradford

Next Thread | Thread List | Previous Thread Start a Thread | Settings