donkey41
Full Member level 1
msp430 assembler
hello everyone,
I have some basic knowledge of assembler, mostly of PIC, but at the moment I have
to do some work with MSP430 in GNUed Compiler, the MSPGCC.
I got an example code, doing something with uart, and unfortunately I am unable
to understand it fully.
In the following code :
the 5th line defines a function "putcahr" as
.type putchar, @function
what does this exactly mean ?
All what I know is that the programmer has used the printf() function in main
program of this uart example, and in order to use printf, you have to create
your own putchar() funtion.
I was also unable to find any function declaration method in assembly, partly
because there is no msp430-as (mspgcc assembler) manual or at least I could not
find it.
hello everyone,
I have some basic knowledge of assembler, mostly of PIC, but at the moment I have
to do some work with MSP430 in GNUed Compiler, the MSPGCC.
I got an example code, doing something with uart, and unfortunately I am unable
to understand it fully.
In the following code :
Code:
/**
send a single character over the UART, first wait until transmit buffer is empty
*/
.global putchar
.type putchar, @function
putchar: ;send a byte
.L1: bit.b #TXEPT, &UTCTL0 ;tx buffer empty?
jnc .L1 ;no -> loop until it is
mov.b r15, &TXBUF0
mov #1, r15
ret
the 5th line defines a function "putcahr" as
.type putchar, @function
what does this exactly mean ?
All what I know is that the programmer has used the printf() function in main
program of this uart example, and in order to use printf, you have to create
your own putchar() funtion.
I was also unable to find any function declaration method in assembly, partly
because there is no msp430-as (mspgcc assembler) manual or at least I could not
find it.