Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

explaination of this example MSP430 Assembler code ?

Status
Not open for further replies.

donkey41

Full Member level 1
Joined
Feb 19, 2002
Messages
99
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Pakistan
Activity points
949
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 :

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.
 

msp430 example code

you might regard it as a declared statement.
If I am wrong, please correct me...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top