0

I need an assembly to C decompiler, I tried this one https://onlinedisassembler.com/odaweb/ but my code looks like this:

#include <p16F887.inc>

     cblock 0x20
Delay1           ; Assign an address to label Delay1
Delay2
Display          ; define a variable to hold the diplay
     endc
          
     org 0
Start:
     bsf       STATUS,RP0     ; select Register Bank 1
     movlw     0xFF
     movwf     TRISA          ; Make PortA all input
     clrf      TRISD          ; Make PortD all output
     movlw     0x00           ; Left Justified, Vdd-Vss referenced
     movwf     ADCON1
     bsf       STATUS,RP1     ; select Register Bank 3
     movlw     0xFF           ; we want all Port A pins Analog
     movwf     ANSEL
     bcf       STATUS,RP0     ; back to Register Bank 0
     bcf       STATUS,RP1
     
     movlw     0x41
     movwf     ADCON0         ; configure A2D for Fosc/8, Channel 0 (RA0), and turn on the A2D module
MainLoop:
     nop                      ; wait 5uS for A2D amp to settle and capacitor to charge.
     nop                      ; wait 1uS
     nop                      ; wait 1uS
     nop                      ; wait 1uS 
     nop                      ; wait 1uS
     bsf       ADCON0,GO_DONE ; start conversion
     btfss     ADCON0,GO_DONE ; this bit will change to zero when the conversion is complete
     goto      $-1

     movf      ADRESH,w       ; Copy the display to the LEDs
     movwf     PORTD
     goto      MainLoop

     end

and I don't know how to use it. I've looked a lot for another but either my code is not working or I can't install it. I would appreciate any help

1
  • 2
    Hi and welcome to RE.SE. As it stands you will have to tell at least what CPU this code targets and circumstantial information usually also helps in RCE efforts. Also, usually it's expected that you demonstrate a basic understanding of the issue and tell whatever you have tried (not just from a bird's view).
    – 0xC0000022L
    May 6 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.