chap4.c
来自「Motorola 6805嵌入式接口设计开发原程序」· C语言 代码 · 共 29 行
C
29 行
// Chapter 4 6805 C programs// Jonathan W. Valvano// This software accompanies the book,// Embedded Microcomputer Systems: Real Time Interfacing// published by Brooks Cole, 1999// Program 4.3. This C function is nonreentrant because of the read-modify-write access to a global. unsigned int Money; /* bank balance implemented as a global *//* add 100 dollars */void more(void){ Money += 100;}// Program 4.5. This C function is nonreentrant because of the write-read access to a global. int temp; /* global temporary *//* calculate x+2*d */int mac(int x, int d){ temp = x+2*d; /* write to a global variable */ return (temp);} /* read from global */// Program 4.7. This C function is nonreentrant because of the multi-step write access to a global. int info[2]; /* 32-bit global */void set(int x, int y){ info[0]=x; info[1]=y;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?