Giter Site home page Giter Site logo

asm's Introduction

This section contains the code of my journey into asm. 

My current system is 64bit and linux(arch) so all the asm code is for this plateform. 
In any case you can do whatever you want with the code at the condition you quote your sources. 

-- fibo.asm: 
it is an attempt to compute the fibonacci number only based on register (r11/r12)
So once the integer is bigger than 64bits its unecessary to continue to compute. 
May be next step would be to implement a bigmath routine which instead of relying only on register with size limitation
should just use buffer. 
The main operation to implement would be the addition of two buffers. 

During the coding of fibo, i realise that the main problem is not to compute arithmetic operation on register, the loop
and the addition juste take 6 lines in the code, but the main problem is to display value. 


---------------------------------------------------------
Commit of 02/2014:
Adding fibo2test.asm using mmx registers and instruction instead of standard registers ! :) 
---------------------------------------------------------

Registers are just number in binary format (or hex) and displaying the content is not so easy. 
Indeed to display a decimal integer needs a dedicated process which take more instruction than just adding two registers.
I isolated two process: 
- rax2hex.asm which displays the content of the rax register (64bits) into 16chars representings the Hexadecimal value. 
- rax2dec.asm which displays the content of the rax register (64bits) into a decimal integer. 

Currently the code of rax2dec.asm is the one used in fibo.asm. 
But the rax2hex.asm was my first attempt and running fine too in the first version of fibo.asm. 

Have fun
---------------------------------------------------------
Commit of 16/10/2022
Adapt 10power.asm to display rdrand instruction result on ia64

Made a test to file a file with random data and compressed it to see just how random it is. 

plonky@micronetmonk:~/work/asm$ ./rdrand  >tmpfile 
^C    
plonky@micronetmonk:~/work/asm$ wc -l tmpfile 
1 tmpfile
plonky@micronetmonk:~/work/asm$ wc -c tmpfile 
497643930 tmpfile
plonky@micronetmonk:~/work/asm$ ls -altr tmpfile 
-rw-rw-r-- 1 plonky plonky 497643930 oct.  16 21:17 tmpfile
plonky@micronetmonk:~/work/asm$ ls -altrh tmpfile 
-rw-rw-r-- 1 plonky plonky 475M oct.  16 21:17 tmpfile
plonky@micronetmonk:~/work/asm$ gzip tmpfile 
plonky@micronetmonk:~/work/asm$ ls -altrh tmpfile.gz 
-rw-rw-r-- 1 plonky plonky 223M oct.  16 21:17 tmpfile.gz

So for a pure text file filed of number, it shrinks from 475mb of size to 223mb. Which is closer to 0.5 ratio than 0.1 ration often seen on text file. 

I cannot tell if the data is very random, but i least the compression ratio close to 0.5 means it's more random than average file. 

---------------------------------------------------------
Netmonk, netmonk at netmonk dot org 
http://www.netmonk.org 
 

asm's People

Contributors

netmonk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.