initial commit
commit
b3f0c60a1f
@ -0,0 +1,2 @@
|
||||
*/settings
|
||||
*/Debug
|
@ -0,0 +1,8 @@
|
||||
|
||||
int main(){
|
||||
int counter = 0;
|
||||
while (counter < 21){
|
||||
++counter;
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project>
|
||||
<fileVersion>4</fileVersion>
|
||||
<fileChecksum>889529122</fileChecksum>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.__cstat.et</file>
|
||||
<file>$PROJ_DIR$\Debug\List\project.map</file>
|
||||
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
|
||||
<file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
|
||||
<file>$TOOLKIT_DIR$\config\linker\TexasInstruments\LM4F120H5QR.icf</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\project.pbd</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\project.out</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl7M_tln.a</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 1 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 7</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>__cstat</name>
|
||||
<file> 0</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 10</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Debug\Exe\project.out</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 6 7 2 5 4 11</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<outputs />
|
||||
<forcedrebuild>
|
||||
<name>[MULTI_TOOL]</name>
|
||||
<tool>ILINK</tool>
|
||||
</forcedrebuild>
|
||||
</configuration>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild />
|
||||
</workspace>
|
@ -0,0 +1,20 @@
|
||||
|
||||
int main(){
|
||||
int counter = 0;
|
||||
while (counter < 21){
|
||||
++counter;
|
||||
//Here we are using the bitwise and operation and is performing the and
|
||||
//operation on every bit of the counter and the second operand "1" in this case
|
||||
// 0001 0010 == 18 0001 0101 == 21
|
||||
// 0000 0001 == 1 0000 0001 == 1
|
||||
// --------------- ---------------
|
||||
// 0000 0000 == 0 0000 0001 == 1
|
||||
if ( counter & 1) != 0){
|
||||
/*do something here when counter is odd*/
|
||||
}
|
||||
else {
|
||||
/*do something here when counter is even*/
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project>
|
||||
<fileVersion>4</fileVersion>
|
||||
<fileChecksum>889529122</fileChecksum>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
|
||||
<file>$PROJ_DIR$\Debug\List\project.map</file>
|
||||
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
|
||||
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
|
||||
<file>$TOOLKIT_DIR$\config\linker\TexasInstruments\LM4F120H5QR.icf</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\project.pbd</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl7M_tln.a</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\project.out</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.__cstat.et</file>
|
||||
<file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 2 8</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 11</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>__cstat</name>
|
||||
<file> 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Debug\Exe\project.out</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 2</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 5 1 4 10 3 7</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<outputs />
|
||||
<forcedrebuild>
|
||||
<name>[MULTI_TOOL]</name>
|
||||
<tool>ILINK</tool>
|
||||
</forcedrebuild>
|
||||
</configuration>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild />
|
||||
</workspace>
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
This allocates the counter variable in RAM
|
||||
As you can see in the Watch1 window after watching the
|
||||
counter variable and we see indeed in is stored at 0x20000000
|
||||
address in memory
|
||||
|
||||
Looping through the dissassembly we now see that LDR.N instruction
|
||||
is being used to increment the value as opposed to the ADD instruction
|
||||
Looking at R0 we can see that the value is storing 0x20000000
|
||||
So R0 is referencing our int stored in RAM
|
||||
|
||||
LDR.N means load the Register from memory
|
||||
The STR instruction is used here to save the value of R1 to the
|
||||
memory location reference in R0.
|
||||
|
||||
|
||||
An Arm processor is a Reduced Instruction Set Computer (RISC) Architecture
|
||||
Memory can be only read by the special load instructions (e.g. LDR, LDR.N)
|
||||
with data manipulations occuring only in the registers. Finally, the modified
|
||||
register values can be stored back into memory using the store instuctions (STR)
|
||||
|
||||
This is in contrast to the Complex Instruction Set Computer (CISC) that make up
|
||||
instruction sets like the x86 where some of the complex operands can be operated
|
||||
on directly in memory.
|
||||
|
||||
Take note that using the *p_int pointer simplifies the instructions produced by
|
||||
the compiler. Instead of multiple calls to LDR.N and STR to load and store our
|
||||
counter we instead load it once then operate directly o
|
||||
|
||||
*/
|
||||
|
||||
int counter = 0;
|
||||
|
||||
|
||||
int main(){
|
||||
// locations in memory can be stored in pointers
|
||||
int *p_int;
|
||||
// The operator & gives the address of the counter variable assigning it to
|
||||
// p_int.
|
||||
p_int = &counter;
|
||||
// To get the value stored at that memory location we must derefence it with
|
||||
// the * operator. *p_int then means the valu
|
||||
while (*p_int < 30){
|
||||
++(*p_int);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
This allocates the counter variable in RAM
|
||||
As you can see in the Watch1 window after watching the
|
||||
counter variable and we see indeed in is stored at 0x20000000
|
||||
address in memory
|
||||
|
||||
Looping through the dissassembly we now see that LDR.N instruction
|
||||
is being used to increment the value as opposed to the ADD instruction
|
||||
Looking at R0 we can see that the value is storing 0x20000000
|
||||
So R0 is referencing our int stored in RAM
|
||||
|
||||
LDR.N means load the Register from memory
|
||||
The STR instruction is used here to save the value of R1 to the
|
||||
memory location reference in R0.
|
||||
|
||||
|
||||
An Arm processor is a Reduced Instruction Set Computer (RISC) Architecture
|
||||
Memory can be only read by the special load instructions (e.g. LDR, LDR.N)
|
||||
with data manipulations occuring only in the registers. Finally, the modified
|
||||
register values can be stored back into memory using the store instuctions (STR)
|
||||
|
||||
This is in contrast to the Complex Instruction Set Computer (CISC) that make up
|
||||
instruction sets like the x86 where some of the complex operands can be operated
|
||||
on directly in memory.
|
||||
|
||||
BTW p_int = (int *)0x20000002U; is a hack where you can grab a reference to
|
||||
a specific block of memory. Super dangerous
|
||||
|
||||
BTW 0xDEADBEEF is a valid 32 bit hexadecimal number
|
||||
*/
|
||||
|
||||
int counter = 0;
|
||||
|
||||
|
||||
int main(){
|
||||
// locations in memory can be stored in pointers
|
||||
int *p_int;
|
||||
// The operator & gives the address of the counter variable assigning it to
|
||||
// p_int.
|
||||
p_int = &counter;
|
||||
// To get the value stored at that memory location we must derefence it with
|
||||
// the * operator. *p_int then means the valu
|
||||
while (*p_int < 30){
|
||||
++(*p_int);
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project>
|
||||
<fileVersion>4</fileVersion>
|
||||
<fileChecksum>889529122</fileChecksum>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$TOOLKIT_DIR$\config\linker\TexasInstruments\LM4F120H5QR.icf</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.__cstat.et</file>
|
||||
<file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
|
||||
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl7M_tln.a</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\project.out</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\project.pbd</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
|
||||
<file>$PROJ_DIR$\Debug\List\project.map</file>
|
||||
<file>$PROJ_DIR$\main2.c</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 5 11</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Debug\Exe\project.out</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 11</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 0 10 3 2 8 4</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 10</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>__cstat</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 7</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<outputs />
|
||||
<forcedrebuild>
|
||||
<name>[MULTI_TOOL]</name>
|
||||
<tool>ILINK</tool>
|
||||
</forcedrebuild>
|
||||
</configuration>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild />
|
||||
</workspace>
|
@ -0,0 +1,20 @@
|
||||
|
||||
int main(){
|
||||
int counter = 0;
|
||||
while (counter < 21){
|
||||
++counter;
|
||||
//Here we are using the bitwise and operation and is performing the and
|
||||
//operation on every bit of the counter and the second operand "1" in this case
|
||||
// 0001 0010 == 18 0001 0101 == 21
|
||||
// 0000 0001 == 1 0000 0001 == 1
|
||||
// --------------- ---------------
|
||||
// 0000 0000 == 0 0000 0001 == 1
|
||||
if ( counter & 1) != 0){
|
||||
/*do something here when counter is odd*/
|
||||
}
|
||||
else {
|
||||
/*do something here when counter is even*/
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project>
|
||||
<fileVersion>4</fileVersion>
|
||||
<fileChecksum>889529122</fileChecksum>
|
||||
<configuration>
|
||||
<name>Debug</name>
|
||||
<outputs>
|
||||
<file>$PROJ_DIR$\main.c</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.o</file>
|
||||
<file>$PROJ_DIR$\Debug\List\project.map</file>
|
||||
<file>$TOOLKIT_DIR$\lib\m7M_tls.a</file>
|
||||
<file>$TOOLKIT_DIR$\lib\shb_l.a</file>
|
||||
<file>$TOOLKIT_DIR$\config\linker\TexasInstruments\LM4F120H5QR.icf</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\project.pbd</file>
|
||||
<file>$TOOLKIT_DIR$\lib\dl7M_tln.a</file>
|
||||
<file>$PROJ_DIR$\Debug\Exe\project.out</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.__cstat.et</file>
|
||||
<file>$TOOLKIT_DIR$\lib\rt7M_tl.a</file>
|
||||
<file>$PROJ_DIR$\Debug\Obj\main.pbi</file>
|
||||
</outputs>
|
||||
<file>
|
||||
<name>[ROOT_NODE]</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 2 8</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\main.c</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ICCARM</name>
|
||||
<file> 1</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>BICOMP</name>
|
||||
<file> 11</file>
|
||||
</tool>
|
||||
<tool>
|
||||
<name>__cstat</name>
|
||||
<file> 9</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\Debug\Exe\project.out</name>
|
||||
<outputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 2</file>
|
||||
</tool>
|
||||
</outputs>
|
||||
<inputs>
|
||||
<tool>
|
||||
<name>ILINK</name>
|
||||
<file> 5 1 4 10 3 7</file>
|
||||
</tool>
|
||||
</inputs>
|
||||
</file>
|
||||
</configuration>
|
||||
<configuration>
|
||||
<name>Release</name>
|
||||
<outputs />
|
||||
<forcedrebuild>
|
||||
<name>[MULTI_TOOL]</name>
|
||||
<tool>ILINK</tool>
|
||||
</forcedrebuild>
|
||||
</configuration>
|
||||
</project>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<workspace>
|
||||
<project>
|
||||
<path>$WS_DIR$\project.ewp</path>
|
||||
</project>
|
||||
<batchBuild />
|
||||
</workspace>
|
Loading…
Reference in New Issue