1. Introduction - Programming language levels
Systems Architecture - 1. Introduction to C 10
High level program
Machine code
#include <stdio.h>
int main() {
printf("Hello world\n");
return 0;
}
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
It provides abstractions (close to the
natural language) independent of a
particular type of computer.
Programmer friendly, portable, easier
to create, debug, and maintain
Low-level program (assembly)
org 0x100 ; .com files always start 256 bytes into the segment
mov dx,msg ; the address of or message in dx
mov ah,9; ah=9 - "print string" sub-function
int 0x21 ; call dos services
mov ah,0x4c ; "terminate program" sub-function
int 0x21 ; call dos services
msg db 'Hello, World!',0x0d,0x0a,'$' ; $-terminated message
Mnemonics that represent basic
instructions that can be directly
translated to machine code. Highly
memory efficient but non-portable
and much more difficult to create,
debug, and maintain
Executable code (1’s and 0’s). Each
instruction causes the CPU to
perform a specific task (e.g. load
value, arithmetic operation, etc.)
1010101110101011111010101010101010101011010101010101010101010110101
1101110000110100010101010010101010101011010001010101010101010110101