This repository is used to publish the code I made for Organisation and Computer Architecture classes.
Each catalogue is another task I had to prepare. Every .s
file contains Assembly code in AT&T notation.
DISCLAIMER. These codes might not work nor shall be treated as a model to follow, especially those mentioned in Previous codes section.
Using SSE. Read more… [PL]
- (NOT DONE) using-sse-to-filter-image — in a pre-prepared program create a function
Filter(…)
to apply a bas-relief filter to the image (method described in readme).
Using x87 FPU. Read more… [PL]
- x87-exception [C code], [asm code] — raise 2 exceptions, at least one different than divide-by-zero / inv.
- (NOT DONE) x87-precision [C code], [asm code] — change calculations precision and show it's working on an example.
- x87-round-mode [C code], [asm code] — change rounding mode and present it's working (explain what were the bits used to round the result (THIS PART IS NOT DONE)).
- (NOT DONE) x87-instruction-level-parallelism — write two sets of instructions such that one has many dependencies on previous results and the other has them a few. Check times.
Using asm and C. Read more… [PL]
- asm-scanf-printf — create an asm function that uses
scanf
andprintf
functions from C Standard Library, reading from standard input two values of typesint
andchar *
, and writing them back to stdout. - asm-rdtsc, c-rdtsc — create an asm function returning value returned by
rdtsc
; write a C program that will use the function and print out to standard output its output. - (NOT DONE) Create C program that will use variables defined in an asm code (
short
,char []
) and an asm program that will use C variables (int
,char *
). - asm-rdtsc-measurement, c-rdtsc-measurement — measure CPU ticks using
rdtsc
for: (1) a registry operation, (2) a memory operation, (3)write
function, (4)printf
function.
- ascii-dec-to-bin — (NOT COMPLETED) read unknown amount of unknown length records of ASCII chars representing decimal numbers, splitted by
\n
, and convert them to 255×8 bits (NOT ASCII CHARS).
- reverse-bits — read unknown amount of bytes from STDIN, reverse bits in each byte and print them on STDOUT.
- arithmetic-exceptions — create assembly functions to control ALU exceptions register (control word) and a C program to test if setting the register gives a result.
- cpuid-cache — check Intel processor's cache levels, its type, size and so on.
-
taylor-series-approx — create an assembly function approximating
$log(1+x)$ with Taylor series. -
using-sse-mmx — create a C and an assembly function (using SSE/MMX) that will do the same operation on two long vectors (adding, multiplying by const.); compare resulting vectors. Compare time using
rdtsc
.