1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I need Help please

Discussion in 'Assembly Language Programming (ALP) Forum' started by valley, Sep 22, 2009.

  1. valley

    valley New Member

    Joined:
    Sep 22, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    can u send me a program for sorting of numbers in assembly language for 8051 microprocessor
     
  2. SaswatPadhi

    SaswatPadhi ~ Б0ЯИ Τ0 С0δЭ ~

    Joined:
    May 5, 2009
    Messages:
    1,343
    Likes Received:
    55
    Trophy Points:
    0
    Occupation:
    STUDENT !
    Location:
    Orissa, INDIA
    Home Page:
    No we can't.

    How far have you reached and where are you stuck ??
    Show us some code and we will help you advance. We can't do the whole thing for you.

    Well, to help you get started, here is a MASM code sort an array of len DWORDS :
    Code:
    bs proc array:DWORD,len:DWORD
    	mov ecx,len
    	mov edx,array
    	bs_o:
    	xor ebp,ebp
    	bs_i:
    	mov eax,DWORD PTR [edx+ebp*4+4]
    	cmp DWORD PTR [edx+ebp*4],eax
    	jb @F
    	xchg eax,DWORD PTR [edx+ebp*4]
    	mov DWORD PTR [edx+ebp*4+4],eax
    	@@:
    	add ebp,1
    	cmp ebp,ecx
    	jb bs_i
    	loop bs_o
    	pop ebp
    	retn 8
    bs endp
    
     
  3. valley

    valley New Member

    Joined:
    Sep 22, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    What i did is that:

    CSEG AT 20
    ?C_START:MOV A,0x40
    CJNE A, #255, NOTEQUAL
    jmp loop
    NOTEQUAL: INC R3
    MOV A,0x41
    CJNE A, #255, NOTEQUAL2
    jmp Final
    NOTEQUAL2: INC R3
    MOV A,0x42
    CJNE A, #255, NOTEQUAL3
    jmp Final
    NOTEQUAL3: INC R3
    MOV A,0x43
    CJNE A, #255, NOTEQUAL4
    jmp Final
    NOTEQUAL4: INC R3
    MOV A,0x44
    CJNE A, #255, NOTEQUAL5
    jmp Final
    NOTEQUAL5: INC R3
    Final: mov R0,#0x40
    mov a,@R0
    mov 0x60, a
    INC R0
    mov a, @R0
    SUB a,0x60
    JC Final

    LOOP: ljmp loop
    PUBLIC ?C_START
    END

    can you fixed it and where I make my mestake
     

Share This Page