?? math.c
字號:
#include <..\math.h> //Place the include file here. '..\. used to locate the math.h
//We need to tell the compiler that we are going to use some variables outside
//this file. We use the 'extern' keyword. The format for using extern is:
// extern <type> RamLocation
// extern - Keyword to tell the compiler the location is outside this module
// <type> - Type is the C declaration (char,int) of the ram location - default is int
// Ex. Var blk 1 equates to char
// Var blk 2 equates to int
// Var blk 4 equates to long
// RamLocation - This is the name of the ram location with the _ we declared in main.asm
extern int OperandOne; //Notice we dont have the _ we just need it on the export
extern int OperandTwo;
extern long OperandThree;
extern long Result;
//Here we declare our C Function. We do not use the _ even though we call it using
//the _
void Addition()
{
//In this function we will add the two numbers in OperandOne and OperandTwo
//We will place the location in Result
Result = OperandTwo + OperandOne;
}
void Multiplication()
{
//Lets perform a larger calculation that might be a little tougher in
//assembly
Result = OperandThree * OperandOne;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -