Dan Goldsmith
; linker puts the entry point here:
_start:
; Write the string to stdout:
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
; Exit via the kernel:
mov ebx,0 ;process' exit code
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel - this interrupt won't return
It’s much easier for most people to write an English statement than it is to use symbols. So I decided data processors ought to be able to write their programs in English, and the computers would translate them into machine code.
I hear and I forget. I see and I remember. I do and I understand.
Confucius
#include
int main() {
// put your setup code here, to run once:
//Setup the LED1 pin to be a digital output called ledOne
DigitalOut ledOne(LED1);
while(1) {
// put your main code here, to run repeatedly:
printf("Loop\n");
ledOne = 1;
ThisThread::sleep_for(500ms);
ledOne = 0;
ThisThread::sleep_for(500ms);
}
}
int led;
char* thestring[50];
int led=5;
string name="dan";
char letter=0x42;
int a = 5+1
1==1
int foo
while (1)
if (foo == 1)
int x=5; while (x > 0){ printf("Value of X is %d\n", x); }
int x=5;
while (x > 0){
printf("Value of X is %d\n", x);
}
;
{ }
src/main.cpp: In function 'int main()':
src/main.cpp:14:5: error: expected ';' before 'ledOne'
ledOne = 1;
if (variable == value){
//do something
}
else{
//Do something else
}
for (int x=0; x<10; x++){
//do something
}
int x=0 //Start condition
while (x<10){
//do something
x+=1 // DON'T forget to update the condition
}
int add(int first, int second){
int out = first+second;
return out;
}
class flasher {
//variables go here
//Methods go here
int add(int first, int second){
...
}
}