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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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...
If you need to make the program start at location 0x20 instead of 0x00, you can write
Why do you need to put in org 0x20?
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.
We can help.
Can tell us what you are trying to achieve? or, post what code you have developed.
Thank you.
...for example:
start:
test: '(0X20 ADDRESS !!!)
THANKS FOR !!!
Cristiano Henz
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
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
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
ok...Thanks.
Cristiano
Did my answer help you.
I would recommend a mix if you want you asm.