/examples

some code examples

Primary LanguageAssembly

    Some examples


1.  Hello world [C]
     - Just printf('Hello world') in C.
    
2.  Merge sort for files [C]
     - Read / write files, merge sort.
    
3.  Boot hello [nasm]
     - Read 2nd hdd sector from 1st sector.
    
4.  Boot and run protected mode [nasm]
     - Prepare idt, gdt and turning on PM.
    
5.  Cache speed [C][Bash]
     - Benchmarks,
     - volatile,
     - using affinity mask for processes.
    
6.  Loader (change default INT to custom); Call asm from C [nasm][C]
     - #4 with changing default interrupt,
     - define global asm function and call it from C.
    
7.  Show which files changed [Bash]
     - Just another bash script.
    
8.  Catch SIG [C]
     - Linux signal example.
    
9.  MultiThread Life. One thread for calc, one thread for print [C]
     - Using threads.
    
10. Client-server Life via TCP [C]
     - Using TCP sockets.
    
11. Dekker lock (critical section) [C]
     - Using Dekker lock for protecting critical section.
    
12. Dekker lock with mfence [C]
     - Fix #11 to prevent caching.
    
13. Using sys select [C]
     - sys/select example.

14. Crypt [nasm][perl]
    - GOST 34.10-94 in nasm (slow sign).
    - Crypto encode with weak encode on demaind.
    - Crypto encode with backdoor.
    - Safe game without 3rd part server.
    - Crypto encoded broadcast/multicast(!) chat.

15. Sea Wars [tasm]
    - Game for DOS with network support (using COM-port).