This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;+------------------------------------------------------------------+ | |
;| Create simple window using ASMx86 with Xlib | | |
;| --------------------------------------------- | | |
;| | | |
;| This source code demonstrates on how to create GUI using | | |
;| ASMx86 NASM Language with Xlib. | | |
;| | | |
;| HOW TO COMPILE | | |
;| ---------------- | | |
;| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [T] = test() | |
%Arrival Time | |
A = [ 2.17, 7.90, 15.00, 15.17, 15.73,... | |
18.74, 19.86, 22.51, 23.70, 31.06]; | |
%Begin service | |
W = [0 0 0 0 0 0 0 0 0 0]; | |
%Service Time | |
S = [0.10, 4.46, 3.25, 2.26, 4.12, 0.69, 0.77, 3.48, 0.26, 0.41]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 1 2 3 4 5 6 7 | |
;01234567890123456789012345678901234567890123456789012345678901234567890 | |
;======================================================================= | |
;+---------------------------------------------------------------------+ | |
;| | | |
;| Example using brk() system call for dynamic memory allocations. | | |
;| | | |
;| DON'T CONFUSE that brk() used in C Function is different with brk() | | |
;| systemcall (systemcall 45 for x86 ASM). | | |
;| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 1 2 3 4 5 6 7 | |
;01234567890123456789012345678901234567890123456789012345678901234567890 | |
;======================================================================= | |
;+---------------------------------------------------------------------+ | |
;| | | |
;| Example using FPU registers for floating point calculations. | | |
;| | | |
;| The purpose of this source code is to demonstrate on how to | | |
;| do floating-point operations using FPU registers. | | |
;| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 1 2 3 4 5 6 7 | |
;01234567890123456789012345678901234567890123456789012345678901234567890 | |
;======================================================================= | |
;+---------------------------------------------------------------------+ | |
;| | | |
;| Example using FPU registers for floating point calculations. | | |
;| | | |
;| The purpose of this source code is to demonstrate on how to | | |
;| do floating-point operations using FPU registers. | | |
;| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 1 2 3 4 5 6 7 | |
;01234567890123456789012345678901234567890123456789012345678901234567890 | |
;======================================================================= | |
;+---------------------------------------------------------------------+ | |
;| | | |
;| Print floating-point number to stdout | | |
;| | | |
;| This example shows how to print double value from FPU register | | |
;| to stdout. | | |
;| | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*===================================================================== | |
+-------------------------------------------------------------------+ | |
| | | |
| Example how to read "Hello World" from stdin | | |
| | | |
| The main problem with scanf() is it unable to read properly | | |
| a string that have "space" character. | | |
| | | |
| This example will show how to read a string that have "space" | | |
| character. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
/********************* price_after_discount() *********************** | |
* Find the price of an item after the discount | |
* | |
* @argument1: price = item price. | |
* @argument2: discount = percentage of discount. | |
* | |
* @return: item price after discount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How the GNU GCC compiler calculate the equation: | |
x + ++y - x * ++x - --y | |
The algorithm used when perform this computation may be different across | |
compilers. This program is compiled using compiler GNU GCC 4.8.3 built for | |
Red Hat 4.8.3-7. Tools that are used to reverse engineer or disassemble | |
this program are "objdump" and "GNU GDB debugger". | |
The program will solve the following problem: | |
x + ++y - x * ++x - --y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
int x = 2; | |
int z = 0; | |
z = ++x + ++x + ++x; |
OlderNewer