User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Software Development category of DaniWeb, a massive community of 428,212 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,244 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Software Development advertiser: Programming Forums
Nov 7th, 2007, 11:12 pm
Taking the "fright" out of Opcodes and Hex-numbers.

High Level Assembly (HLA) is a modern assembler + standard library package that allows a programmer to ease his way toward ASM coding by leveraging concepts already learned from typical high-level languages. By using HLA, one can investigate and play with a few ASM instructions at a time while coding the remainder of the application using built-in functions and flow-control constructs that one should already be accustomed to. As one gains confidence with traditional assembly coding, they can begin to eliminate the high-level parts of the application by re-coding them in straight ASM.

Here is an example to demonstrate how an HLA application looks very close to how one might write the same program in C or other traditional language.

// cross-platform:  Linux & Windows now; others in the works...
// get HLA here:  http://www.artofasm.com

program demo;
#include( "stdlib.hhf" )

const
    
    ITERATIONS		:uns32	:=	10000;
    MAX_VALUE		:uns32	:=	100;
    
static
    
    items	:uns32[ITERATIONS];
    freq		:uns32[MAX_VALUE+1];
    mixed	:file;
    sorted	:file;
    
begin demo;
    
    /* initialization
    */
    rand.randomize();
    mixed.create();  // these are file objects
    mixed.openNew( "sfalse.txt" );
    sorted.create();
    sorted.openNew( "strue.txt" );
    
    /* create the unsorted array
    */
    mov( 0, ecx );
    repeat
        
        rand.range( 0, MAX_VALUE );  // returns value in 'eax'
        mov( eax, items[ecx*4] );  // puts value into array
        mixed.put( (type uns32 ecx):5, ": ", (type uns32 eax), nl );
        // mirror to file
        add( 1, ecx );
        
    until ( ecx = ITERATIONS );

    /* record the frequencies of the numbers
    */    
    for( mov( 0, ecx ); ecx < ITERATIONS; inc( ecx ) ) do
        
        mov( items[ecx*4], eax );  // get value from array
        inc( freq[eax*4] );  // increment its frequency count
        
    endfor;

    /* use frequency table to re-order the array
    */
    xor( ecx, ecx );  // could also use 'mov( 0, ecx )'
    xor( ebx, ebx );
    while( ebx < MAX_VALUE+1 ) do
        
        mov( freq[ebx*4], eax );  // get frequency count
        if ( eax != 0 ) then
            
            // keep storing that number until eax = 0
            repeat
            
                mov( ebx, items[ecx*4] );
                sorted.put( (type uns32 ecx):5, ": ", (type uns32 ebx), nl );
                // mirror to file
                inc( ecx );  // could also use 'add( 1, ecx )'
                dec( eax );  // sets Zero Flag if eax = 0
                
            until ( @z );  // check if Zero Flag is set
        
        endif;
        
        add( 1, ebx );
        
    endwhile;
    
    mixed.close();
    sorted.close();
    
end demo;

Get HLA and the *free* online version of "Art of Assembly" here: http://www.artofasm.com
Get an IDE specifically for HLA (Windows only) here: http://sevag.krikorian.googlepages.com/
This blog entry was written by Evenbit. It has received 1,702 views, 3 comments, and 3 linkbacks.
AddThis Social Bookmark Button

Comments (Newest First)
Evenbit | Junior Poster in Training | Nov 27th, 2007
Processor manuals are your best choice.

Intel --
http://www.sandpile.org/docs/intel/ia-32.htm

AMD --
http://www.sandpile.org/docs/amd/k6.htm
felmanmark | Newbie Poster | Nov 25th, 2007
Hi im new in java can you pls give me for the code in determing the lowest and highest number in the series of array and asking the user of number and dirrference of the highest and the lowest because i have not any references here because im just living at the dormitory.
Thanks
felmanmark | Newbie Poster | Nov 25th, 2007
HI,
Im an computer science student i must research for the commands used in assembly can anybody give me copy in table form.. The command and its used..
Thank you for thise who reply
Post Comment

Only community members can start a blog or comment on blog entries. You must register or log in to contribute.

DaniWeb Software Development Marketplace

Related Blog Entries
Related Forum Threads
All times are GMT -4. The time now is 3:20 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC