Asm to Basic


Closed Thread
Results 1 to 10 of 10

Thread: Asm to Basic

  1. #1
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18

    Default Asm to Basic

    Hi,

    Is there somebody can help me translate this routine to basic?

    Subroutine_1A
    movlw 0x08
    movwf VarA
    bsf STATUS,RP0 ; !!Bank Register-Bank(0/1)-Select
    bsf PORTB,4 ; !!Bank!! PORTB - TRISB
    bcf STATUS,RP0 ; !!Bank Register-Bank(0/1)-Select
    Subroutine_1B
    btfsc PORTB,4 ; !!Bank!! PORTB - TRISB
    GoTo Subroutine_1B
    clrf VarW
    bsf VarA,7
    GoTo Subroutine_1G
    Subroutine_1C
    bcf VarA,7
    GoTo Subroutine_1G
    Subroutine_1D
    bcf STATUS,C
    rrf VarW,F
    btfsc PORTB,4 ; !!Bank!! PORTB - TRISB
    bsf VarW,7
    bsf VarA,6
    GoTo Subroutine_1G
    Subroutine_1E
    bcf VarA,6
    decfsz VarA,F
    GoTo Subroutine_1D
    bsf VarA,5
    GoTo Subroutine_1G
    Subroutine_1F
    bcf VarA,5
    movf VarW,W
    movwf VarB
    GoTo Subroutine_1I
    Subroutine_1G
    movlw 0x3F
    btfsc VarA,7
    movlw 0x11
    movwf VarB
    Subroutine_1H
    decfsz VarB,F
    GoTo Subroutine_1H
    btfsc VarA,7
    GoTo Subroutine_1C
    btfsc VarA,6
    GoTo Subroutine_1E
    btfsc VarA,5
    GoTo Subroutine_1F
    GoTo Subroutine_1D
    Subroutine_1I
    retlw 0x00

    What is exactly doing it?

    Many Thanks,
    brenda

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    I don't think that anyone is willing to loose his hair in order to decrypt what a dis-assembled program is doing...

    You better learn PBP and do what you want from scratch. It will cost less time and money!

    Ioannis

  3. #3
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Hi Sir,

    I did say if somebody can help me. I know pbp very well but I am zero in asm thats why I am asking for help.

    Thanks anyway,
    brenda

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Subroutine_1A: VarA = 8 : PortB.4 = 1
    Subroutine_1B: If PortB4 = 1 then GoTo Subroutine_1B
    W = 0 : VarA = Var | $80 : GoTo Subroutine_1G
    Subroutine_1C: VarA = Var & $7F : GoTo Subroutine_1G
    Subroutine_1D: VarW = VarW >> 1 : If PortB.4 = 1 then VarW = VarW | $80
    VarA = VarA | $40 : GoTo Subroutine_1G
    Subroutine_1E: VarA = VarA & $BF : VarA = VarA - 1 : If VarA > 0 then Goto Subroutine_1D
    VarA = VarA | $20 : GoTo Subroutine_1G
    Subroutine_1F: VarA = VarA &DF : VarB = VarW : GoTo Subroutine_1I
    Subroutine_1G: VarA = $3F
    If VarA.7 = 0 then
    VarA = $3F
    Else
    VarA = $11
    EndIf
    Subroutine_1H: VarB = VarB - 1 : If VarB > 0 Then GoTo Subroutine_1H
    If VarA.7 = 0 Then GoTo Subroutine_1C
    If VarA.6 = 0 Then GoTo Subroutine_1E
    If VarA.5 = 0 Then GoTo Subroutine_1F
    GoTo Subroutine_1D
    Subroutine_1I: Return


    What is this subroutine doing? Who knows...who cares...
    But if that above actually translated correctly and really worked...I would poopy myself

  5. #5
    Join Date
    Mar 2004
    Location
    Manila
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask

    Really appreciate your work. I'll let you know what is the function of this routine once I completed analyzing it. Might take time but I will try.

    brenda

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi,....

    another look !!!

    Looks like an intelligent pushbutton ...

    Alain
    Attached Files Attached Files
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,....

    another look !!!

    Looks like an intelligent pushbutton ...

    Alain
    Intelligent pushbuttons!
    What will they think of next!

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi,Skimask

    I think Mel. has already treated this subject ( in PbP ...LoL ) in these columns ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,Skimask

    I think Mel. has already treated this subject ( in PbP ...LoL ) in these columns ...

    Alain
    Most likely (what hasn't Mel addressed?), but who ever heard of 'Searching the Forums'...

  10. #10
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    What is this subroutine doing? Who knows...who cares...
    But if that above actually translated correctly and really worked...I would poopy myself
    .................... ROTFL!!!!
    No seriously.... people are asking me why I'm laughing so hard!
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

Similar Threads

  1. PBP, ASM and LST files
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2010, 13:43
  2. Basic e Asm
    By GiuseppeP in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th November 2009, 14:08
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Interrupt Latency - ASM vs. Basic
    By barkerben in forum General
    Replies: 5
    Last Post: - 1st January 2005, 21:09
  5. ASM Interrupts with BASIC code?
    By Desterline in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st October 2003, 19:21

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts