Lets have a look at the Assembly language. Assembly is one level above binary, which runs on your hardware. The Assembler converts Assembly into binary. In the following 'Hello World' code we are working with the registers of a Raspberry Pi, which are contained in the CPU and can hold up to 32 bits.
This is the code:
.global _start _start: MOV R7, #4 //System call to output to screen MOV R0, #1 //Set monitor as output stream MOV R2, #12 //String Length LDR R1, =message //Load register with address of string SWI 0 //Software interrupt end: MOV R7, #1 SWI 0 //This combined with line above:Software interrupt, //saying to return to the terminal .data //Signify that what follows is data message: .ascii "Hello World\n"
MOV R7, #4 means, that we put a 4 into the register 7 and it tells the System to output something on the screen. LDR means "load" and inside R7 there will be saved the starting adress of the String "message". SWI is the so called software interrupt function.
A software interrupt sends a signal to the Operating System. When it receives this interrupt signal it will check the values which are in the registers R0 and R7 and act accordingly, printing Hello World to the screen. After this it continues with the following lines in the code and returns to the terminal.
Did you work with Assembly yet and what did you program? Have a nice day. :)