墙上喷漆字怎么去掉:C语言和汇编语言的混合编程 求例子

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/01 02:42:04
哪位高人可以帮我,用C语言和汇编语言的混合编程,编一个A+B或者A和B的线性卷积的短小程序,谢谢了!
希望程序能够非常简单,

/*
* main.c
* This demnstration code is designed to work with the IP2022 Demo
* Board V1.0 and V3.0.
*
* The demonstration uses the Virtual Peripheral uart in the ipUART package
* to create a simple serial loopback. The UART is configured to use the
* "To PC" port on the demo board with a straight-through serial cable
* connected to a PC terminal program like HyperTerminal.
*
* The UART characteristics are set in the configuration tool.
*
* Copyright ?2001 Ubicom Inc. <www.ubicom.com>. All rights reserved.
*
* This file contains confidential information of Ubicom, Inc. and your use of
* this file is subject to the Ubicom Software License Agreement distributed with
* this file. If you are uncertain whether you are an authorized user or to report
* any unauthorized use, please contact Ubicom, Inc. at +1-650-210-1500.
* Unauthorized reproduction or distribution of this file is subject to civil and
* criminal penalties.
*
* $RCSfile: main.c,v $
* $Date: 2002/07/31 00:37:05 $
* $Revision: 1.25.4.1 $
*/

#include <ipOS.h>
#include <ipUART.h>

/*
* IP2022 configuration block
*/
CONFIG_BLOCK (
FUSE0(FUSE0_XTAL | FUSE0_PIN_DIV1 | FUSE0_POUT_DIV2 | FUSE0_WUDP_128us | FUSE0_WUDX_1ms),
FUSE1(0),
OSC1_FREQ,
"UBICOM",
"starter",
CONFIG_VER(0, 0, 0, 0),
CONFIG_DATE(0, 0, 0),
CONFIG_DATE(0, 0, 0)
);

/* Timer for flashing the LEDs. */
struct oneshot led_timer;

/*
* uart_recv_intr()
*
* This function is called each time a byte is received by the UART.
*
* In this simple demo the byte is simply echoed back.
*/
void uart_recv_intr(void *protocol_instance)
{
u8_t data;
struct uart_instance *uarti = (struct uart_instance*)protocol_instance;

/* Read the received byte from the UART. */
data = uarti->recv(uarti);
/* Transmit the same byte back again. */
uarti->send(uarti, data);
}

/*
* led_callback()
* Callback for the LED timer. We simply flash the LEDs in the nice pattern.
*/
void led_callback(u8_t *led)
{
debug_set_lights(*led);

(*led)++;

/* Reattach the timer so that we get called again. */
oneshot_attach(&led_timer, TICK_RATE/10, (oneshot_callback)led_callback, led);
}

/*
* main()
*/
int main(void)
{
u8_t led = 0;
struct uart_instance *uarti;
except_t ex;

/* Initialize the operating system */
debug_init();
heap_add((addr_t)(&_bss_end), (addr_t)(RAMEND - (DEFAULT_STACK_SIZE - 1)) - (addr_t)(&_bss_end));
timer_init();

/* Create the UART instance and start listening. */
uarti = echo_uart_vp_instance_alloc();
uarti->listen(uarti, uarti, NULL, uart_recv_intr, NULL);

/* Configure the ISR and start it running. */
tmr0_init();
set_int_vector(isr);
global_int_enable();

/* Create the timer that will flash the LEDs. */
oneshot_init(&led_timer);

/*
* Instead of calling the attach method here, we call the callback to
* kick off the timer.
*/
led_callback(&led);

/* Loop forever, flashing the LEDs and polling the UART. */
except_try {
while (TRUE) {
echo_uart_vp_recv_poll(uarti);
echo_uart_vp_send_poll(uarti);
timer_poll();
}
}
except_catch(ex) {
#if defined(DEBUG)
debug_print_prog_str("\nmain: unhandled exception\n");
while (TRUE);
#else
system_reset();
#endif
}

return 0;
}

卷积?>

楼上的大哥你在那个网站抄的告诉小弟