Menu

Asm code in GCBASIC

Help
2013-01-10
2013-05-30
  • alejandro1957

    alejandro1957 - 2013-01-10

    trivial question.
    I need to insert asm code in the code I'm writing in GCBASIC.
    how do you?

     
  • Edward LaBudde

    Edward LaBudde - 2013-01-10

    Hi just type it in like any other code.  Ed.

     
  • alejandro1957

    alejandro1957 - 2013-01-11

    SUB Impulso_US(Time_us AS INTEGER)#NR
    DIM SoftPWM,Cuenta,Ciclo_us AS INTEGER
    Time_us=Time_us/25
    FOR SoftPWM=1 TO Time_us
        MOVLW  0x0C
        MOVWF  Cuenta
        bsf    PORTD,2
        Ciclo_us
               DECFSZ Cuenta,1
               goto Ciclo_us
        MOVLW  0x0C
        MOVWF  Cuenta
        bcf    PORTD,2
        Ciclo_us
               DECFSZ Cuenta,1
               goto Ciclo_us
    NEXT SoftPWM
    END SUB

    Errors.txt

    /home/User/GCBasicIDE/16F877A/16F877A_Robot_4WD/16F877A_Robot_4WD_Sonar/16F877A_Robot_4WD_Sonar.gcb (35): Message TYPEERROR not defined in messages.dat!: Error de Sintaxis
    /home/User/GCBasicIDE/16F877A/16F877A_Robot_4WD/16F877A_Robot_4WD_Sonar/16F877A_Robot_4WD_Sonar.gcb (41): Message TYPEERROR not defined in messages.dat!: Error de Sintaxis
    

    where am I wrong to place the code asm??

    sorry for my english

     
  • Frank

    Frank - 2013-01-12

    The address labels need a colon at the end and they should be unique. DIMing Ciclo_us as an integer is also causing a problem. The following code should compile.

    SUB Impulso_US(Time_us AS INTEGER)#NR
    DIM SoftPWM,Cuenta AS INTEGER
    Time_us=Time_us/25
    FOR SoftPWM=1 TO Time_us
        MOVLW  0x0C
        MOVWF  Cuenta
        bsf    PORTD,2
        Ciclo_us_hi:
               DECFSZ Cuenta,1
               goto Ciclo_us_hi
        MOVLW  0x0C
        MOVWF  Cuenta
        bcf    PORTD,2
        Ciclo_us_lo:
               DECFSZ Cuenta,1
               goto Ciclo_us_lo
    NEXT SoftPWM
    END SUB
    
     
  • alejandro1957

    alejandro1957 - 2013-01-12

    ok, now compile correctly.
    but does not work well.
    obviously the timing is not correct to get with 40khz pic with a 4mhz

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.