Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

frequency byte count of a file

BodoBodo Member Posts: 4
Hello everybody
I have to write a programm with TASM which counts the frequency of each appearing byte ( 0 - 255 )I have really no idea to start. I was think of a structure with 2 elements.
First the byte it self and 2nd the freqency. But in this case I need a array with the size of 255 elements.

example :

00000 00559 |--------------------
00001 00483 |--------------------
00002 00655 |--------------------
00003 00601 |--------------------
00004 00738 |--------------------
00005 00907 |--------------------
00006 01023 |--------------------
00007 01529 |--------------------
00008 02228 |--------------------
00009 03386 |*-------------------
00010 05138 |*-------------------
00011 07923 |**------------------
00012 11773 |***-----------------
00013 16141 |*****---------------
00014 21944 |*******-------------
00015 27679 |********------------
00016 32832 |**********----------
00017 36904 |***********---------
00018 40501 |************--------
00019 42723 |*************-------
00020 43329 |*************-------
00021 42302 |*************-------
00022 40395 |************--------
00023 37990 |************--------
00024 35631 |***********---------
00025 33779 |**********----------

Has anybody a good idea ?
Bodo


Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    Well, what kind of an output this program will have?
    The same as:
    VALUE COUNT | --------------------- ; 20 chars is 100%?
    Is it all supposed to be on screen, or in another file?
    I can help you if I know the specs...


  • AsmGuru62AsmGuru62 Member Posts: 6,519
    My mistake... As soon as it is on screen OUTed by Function 09h INT 21h you can have it on file using redirection:
    FHYST filename >count.txt


  • BodoBodo Member Posts: 4
    : Well, what kind of an output this program will have?
    : The same as:
    : VALUE COUNT | --------------------- ; 20 chars is 100%?
    : Is it all supposed to be on screen, or in another file?
    : I can help you if I know the specs...
    :
    :
    Hi
    yep, about 20 to 20 chars. The range of the Value is 0 .. 255
    and the count is between 0 .. 65535

    Cio Bodo


  • AsmGuru62AsmGuru62 Member Posts: 6,519
    I will send you some code, but why there are only 20 lines in the output, if the range of a BYTE is 255:
    000 COUNT |----------------
    001 COUNT |----------------
    002 COUNT |----------------
    003 COUNT |----------------
    ...
    255 COUNT |----------------
    As you can see it is 256 lines in all.
    Ok, I will do all lines and you decide what to do later...
    Give me a couple of hours...



  • AsmGuru62AsmGuru62 Member Posts: 6,519
    ... Oh man! I got some work to do, so it wasn't a couple of hours, but anyhow... I have the program, but if I paste it here - it gets all garbled. Do you have some HOTMAIL account, so I can attach a file?


Sign In or Register to comment.