Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

HOW to

Status
Not open for further replies.
can you post the ASM file because i get errors when copy and paste
"Executable code and data must be defined in an appropriate section"

I dont want to fix the entire spacing heh
 
Last edited:
I posted on first page:
Code:
     #define L1 PORTB, 2
     #define L2 PORTB, 1
     #define L3 PORTB, 0
     #define L4 PORTA, 1
     #define L5 PORTA, 3

    #define S1 PORTB, 5
    #define S2 PORTB, 6
    #define S3 PORTB, 7
    #define S4 PORTA, 0
    #define S5 PORTA, 4


   
     LIST P=16F84A, R=DEC    ; Use the PIC16F628 and decimal system
     #include "P16F84A.INC"  ; Include header file

        __config  _CP_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC 
	errorlevel -302
        CBLOCK 0x0C 
           DelayTMP1  ;Delay-shi sachiro 
           DelayTMP2 
           DelayTMP  ;Delay-shi sachiro           
           Level  ;Leveli
           TMP1 ;Action-shi sachiroa!
           SPEC ;Sachiroa: 0-statusia 5-ze meti iyo tu ara.
           LAST_TMP
        ENDC

      ;AQ FRTXILAD!
      movlw 0x13
      movwf FSR

        ;TRIS Register Configdeba Sesabamisad!
         BANKSEL TRISA
         movlw b'10001'
         movwf TRISA
         movlw b'11111000'
         movwf TRISB
         clrf INTCON         

         movlw b'00010000'
         movwf OPTION_REG ;1KK Instruqcia wamshi

        BANKSEL PORTA
        clrf PORTA
        clrf PORTB
        movlw 4
        movwf Level
         movwf LAST_TMP
         movlw 0xFF
         movwf DelayTMP1
         movwf DelayTMP2


Starter bsf L1
   bsf L2
   bsf L3
   bsf L4
   bsf L5
   btfsc S1
     goto MMMM
   btfsc S2
   goto MMMM
   btfsc S3
   goto MMMM
   btfsc S4
   goto MMMM
   btfsc S5
   goto MMMM
   goto Starter


MMMM 
   bcf L1
   bcf L2
   bcf L3
   bcf L4
   bcf L5
   movlw 4
call Delay
   movfw Level
   movwf LAST_TMP
      movlw 0x13
      movwf FSR
      clrf SPEC
   
Main decfsz LAST_TMP, f
   goto Action ;Antebs naturas da inaxavs M-shi
ZUZUZUZUZ   movf LAST_TMP, f
   btfsc STATUS, Z
   goto UserTime
   goto Main

;//////////////////////////////////////////////////////////////////////////////////////////         
;//////////////////////////////////////////////////////////////////////////////////////////         
;//////////////////////////////////////////////////////////////////////////////////////////         




Action  movfw TMR0
   movwf TMP1

Act_   movfw TMP1
   sublw 4
   btfsc STATUS, Z
   call LED_5
   


   movfw TMP1
   sublw 3
   btfsc STATUS, Z
   call LED_4


   movfw TMP1
   sublw 2
   btfsc STATUS, Z
   call LED_3


   movfw TMP1
   sublw 1
   btfsc STATUS, Z
   call LED_2
   

   movfw TMP1
   sublw 0
   btfsc STATUS, Z
   call LED_1


   btfsc  SPEC, 0
   incf FSR, f
   btfss  SPEC, 0
   call TMRMinus4
   btfss  SPEC, 0
   goto Act_
   
   ;AQ GVAQ ROMELIME LED-i
   movlw 0x1
   call Delay
   bcf L1
   bcf L2
   bcf L3
   bcf L4
   bcf L5
   movlw 0x1
   call Delay
   
   bcf SPEC, 0
   

   goto ZUZUZUZUZ
   
;//////////////////////////////////////////////////////////////////////////////////////////         
;//////////////////////////////////////////////////////////////////////////////////////////   ;/////////////////////////////////////////////////////////////////////////////////////////         

Delay movwf DelayTMP
JMI decfsz DelayTMP1, f
   goto JMI
   movlw 0xFF
   movwf DelayTMP1
   decfsz DelayTMP2, f
   goto JMI
   movlw 0xFF
   movwf DelayTMP2
   decfsz DelayTMP, f
   goto JMI
   
   return



UserTime movfw Level
   movwf LAST_TMP
   decf LAST_TMP, f
   movlw 0x13;Reset
   movwf FSR

KLL   btfsc S1
   call Switch_1
   


   btfsc S2
   call Switch_2


   btfsc S3
   call Switch_3


   btfsc S4
   call Switch_4


   btfsc S5
   call Switch_5

;CHECK IF ANY WAS CHECKED
   btfss SPEC, 1
   goto KLL

   bcf SPEC, 1
;romeligacas daechira


   decf LAST_TMP, f
   btfsc STATUS, Z
   call NextLevel

   btfsc SPEC, 2
   goto MMMM ;TU BOLOA MIVDIVART MAINSHI!
   goto KLL

Check btfss STATUS, Z
    goto WAAGE
    return






NextLevel  incf Level, f
   bsf SPEC, 2
   movlw 3
   call Delay
   return



LED_5  bsf L5
   bsf SPEC, 0
   movlw 5
   movwf INDF
   return

LED_4  bsf L4
   bsf SPEC, 0
   movlw 4
   movwf INDF
   return

LED_3  bsf L3
   bsf SPEC, 0
   movlw 3
   movwf INDF
   return

LED_2  bsf L2
   bsf SPEC, 0
   movlw 2
   movwf INDF
   return

LED_1  bsf L1
   bsf SPEC, 0
   movlw 1
   movwf INDF
   return

TMRMinus4 
   movfw TMP1
   sublw 5
   movwf TMP1
   comf TMP1, f
   incf TMP1, f
   return



Switch_1 
   movlw 1
   subwf INDF, f
   call Check ;Sworea
   bsf SPEC, 1
   incf FSR, f

   bsf L1
   movlw 0x3
   call Delay
   bcf L1

   return

Switch_2 
   movlw 2
   subwf INDF, f
   call Check ;Sworea
   bsf SPEC, 1
   incf FSR, f

   bsf L2
   movlw 0x3
   call Delay
   bcf L2

   return

Switch_3
   movlw 3
   subwf INDF, f
   call Check ;Sworea
   bsf SPEC, 1
   incf FSR, f

   bsf L3
   movlw 0x3
   call Delay
   bcf L3

   return

Switch_4
   movlw 4
   subwf INDF, f
   call Check ;Sworea
   bsf SPEC, 1
   incf FSR, f

   bsf L4
   movlw 0x3
   call Delay
   bcf L4

   return

Switch_5 
   movlw 5
   subwf INDF, f
   call Check ;Sworea
   bsf SPEC, 1
   incf FSR, f

   bsf L5
   movlw 0x3
   call Delay
   bcf L5

   return


WAAGE 
   movlw 4
   movwf Level
   bsf L1
   bsf L2
   bsf L3
   bsf L4
   bsf L5
   movlw 3
   call Delay
   goto Starter


   END
 
I mean post the ASM file itself heh.. well.. i think its called attach...

Attach the file in a post so i can download and dont have copy paste issue
 
Last edited:
ahaa i got it :))
 

Attachments

  • jako.asm
    5.4 KB · Views: 129
Im having a problem with my MPLAB or something heh...
i get a ton of errors... its not the first time i have seen this so give me a minute...

I have to post my issue on the forum as well...
 
PM me, maybe I can help...
 
LOL I found the problem! I had pullups turned on :D:D
 
right :)) thanks
 
Status
Not open for further replies.

Latest threads

Back
Top