Menu

question about - org -

Help
2015-02-12
2015-02-12
  • Cristiano Henz

    Cristiano Henz - 2015-02-12

    Hello world...
    I have a question... Is there "org 0x20" in Great Cow BASIC compiler? I need to put address 0x20 in compiler.

    microcontroller: 12f629

    Thanks...

     
  • Hugh Considine

    Hugh Considine - 2015-02-12

    If you need to make the program start at location 0x20 instead of 0x00, you can write

    #option bootloader 0x20
    

    Why do you need to put in org 0x20?

     
  • Cristiano Henz

    Cristiano Henz - 2015-02-12

    thanks for your answer... I don´t need start at location 0x20... I need only to go at location 0x20 !!! I´m beginner in Great BASIC...:-)

    Thanks.

     
  • Anobium

    Anobium - 2015-02-12

    We can help.

    Can tell us what you are trying to achieve? or, post what code you have developed.

    Thank you.

     
  • Cristiano Henz

    Cristiano Henz - 2015-02-12

    ...for example:

    start:

    SET LED ON
    NOP
    NOP
    CALL test
    NOP
    GOTO start
    .
    .
    .
    

    test: '(0X20 ADDRESS !!!)

    NOP
    NOP
    SET LED OFF
    NOP
    RETURN
    

    THANKS FOR !!!

    Cristiano Henz

     
  • Anobium

    Anobium - 2015-02-12

    OK. I see.

    Quick question: Do you want to use GCB for assembly programming or to use the higher level functionality which has the goal of minimising the use of assembler?

    You may not need to direct address memory. Have a look this example - it may help you.

    And, this adaption version below:

    ~~~~~
    #chip 16f877a, 4

    ; ----- Define Hardware settings
    ' (PORTA.2 = Pin 5 on PIC12f1501)
    ' this is required to tell the microprocessor the port is an output
    Dir PORTA.2 Out

    ; ----- Variables
    ' none specified in the example. All byte variables are defined upon use.

    ; ----- Main body of program commences here.
    Start:
    Set PORTA.2 ON 'turn LED on
    Wait 100 Ms 'wait 100 milliseconds
    Test 'call a subroutine
    Goto Start 'jump back to the start of the program

    sub Test
    Set PORTA.2 OFF 'turn LED off
    Wait 900 Ms 'wait 900 milliseconds
    end sub

     
  • Cristiano Henz

    Cristiano Henz - 2015-02-12

    oh...ok... Thanks Anobium. I will use both modes assembly and high level language (BASIC) !!! I'm 8051 processor programmer and novice in PIC 12F629. I like use assembly language for my softwares !!!

    Thanks for all.

    Cristiano

     
  • Anobium

    Anobium - 2015-02-12

    You can use assembler code within your Great Cow Basic code. A mix is typical. You can put the assembler code inline in with your source code. The assembler code will be passed through to the assembly file associated with your project. GCBASIC should recognise all of the commands in the microprocessor datasheet. The commands should be in lower case and have a space or tab in front of the command.

    ~~~~~
    '''
    '''Flash Port A.1 and A.2 using GCB and ASM
    '''

    chip 16F877aA, 4

    DIR PORTA.1 out

    Main:

    bsf PORTB,1
    SET PORTB.2 1
    clrw
    goto Main

    Even if the mnemonics are not being formatted properly, gputils/MPASM should still be capable of assemble the source code.

     

    Last edit: Anobium 2015-02-12
  • Cristiano Henz

    Cristiano Henz - 2015-02-12

    ok...Thanks.

    Cristiano

     
  • Anobium

    Anobium - 2015-02-12

    Did my answer help you.

    I would recommend a mix if you want you asm.

     

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.