PDA

View Full Version : Asm to Basic



brenda
- 30th March 2007, 12:38
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

Ioannis
- 30th March 2007, 14:32
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

brenda
- 30th March 2007, 14:41
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

skimask
- 30th March 2007, 14:56
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 :D

brenda
- 30th March 2007, 15:13
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

Acetronics2
- 30th March 2007, 15:57
Hi,....

another look !!!

Looks like an intelligent pushbutton ...

Alain

skimask
- 30th March 2007, 17:37
Hi,....

another look !!!

Looks like an intelligent pushbutton ...

Alain

Intelligent pushbuttons!
What will they think of next! :)

Acetronics2
- 30th March 2007, 17:48
Hi,Skimask

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

Alain

skimask
- 30th March 2007, 18:01
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'... :D

rhino
- 30th March 2007, 20:28
What is this subroutine doing? Who knows...who cares...
But if that above actually translated correctly and really worked...I would poopy myself :D

.................... ROTFL!!!!
No seriously.... people are asking me why I'm laughing so hard!