Anyone good with machine code

Lee_erm
Lee_erm Posts: 56
edited June 2007 in The Crudcatcher
What's happening here?

name "calc-sum"

org 100h ;tells the program where to run the com file from on memory

mov cx, 5;creates register 'cx'

mov al,0 ;creates register al, stores the sum

mov bx,0 ;

next: add al, vector[bx]

inc bx

loop next

mov m, al

ret

;variables:
vector db 5,4,5,2,1
m db 0

I'm trying to comment the code but just failing really, commented the first three lines but i'm stuggling to do the rest. I'm crap with the low level stuff like this. Been an age since it was covered in class too, and notes have gone missing etc.


<center><i><font color="orange">absolutely</font id="orange"></i><font color="red"><i>herming</i></font id="red"><i><font color="orange">along</font id="orange"></i>. </center>

<font size="1"><font color="beige">RIP rich</font id="beige"></font id="size1">

Comments

  • JinjaNinja
    JinjaNinja Posts: 1,033
    do your own homework!

    <hr noshade size="1"><font size="1"><font color="green"><center><i>Originally posted by John</i>

    It'll be like being tw<s></s>ated in the face by the 60s.</center>
    </font id="green"></font id="size1">
    <font color="brown"><center>Join us HERE!</center></font id="brown">
    logo.jpg
  • Lee_erm
    Lee_erm Posts: 56
    It's not homework[V]

    <center><i><font color="orange">absolutely</font id="orange"></i><font color="red"><i>herming</i></font id="red"><i><font color="orange">along</font id="orange"></i>. </center>

    <font size="1"><font color="beige">RIP rich</font id="beige"></font id="size1">
  • breezer
    breezer Posts: 1,225
    um well inc must be increment as in, increment (vector) bx. Loop next does it again but not sure how much of the code it does again. No idea on anything else. I did some 68000 machine code at uni but that was like (omg) 10 years ago (!)

    Do they really teach this stuff these days? Surely its of no use unless you wanted to work in a very specific job supporting it? Would have thought it was all .Net and java now?

    2005 Azonic Propulsion
    1998 DMR Trailstar
    1992 Breezer Lightning Pro
  • newmember
    newmember Posts: 66
    i *think* your post got screwed up and a load of random numbers and letters appeared.

    <center><b><font size="1"><font color="pink">
    -</b></font id="pink"></font id="size1">
    <b>No "I Love Horses" Link Here.</b></center>
    <hr noshade size="1">
    [}:)]
    <font color="white">_</font id="white">\_/\_/\_/\__,

    <b><font color="green">F</font id="green">lur<i>r</i>y co<font color="red">p</font id="red">ied <font color="orange">m</font id="orange">e.</b>
  • Anonymous
    Anonymous Posts: 79,666
    No thats the whole point of his post.
    Thats the code.

    ForBloodAnd Empire
    Nothing says "ouch" like a punctured gut
    Co factory rider for DUST TILL DAWN

    Myspace