I'm new here and just wondering if anybody could explain how this simple code works??
mov al,0    
mov cl, B0 
reset:
add cl, 10 
push cl
pop bl
           
loop:     
mov , al
   
add al, 1   
add bl,1   
cmp bl, 00 
jz reset
jmp loop 

end


Any help is greatly apreciated :)
Posted on 2009-08-07 16:02:04 by cokestructures
And how do YOU think it works? What is your progress in this matter?
Posted on 2009-08-07 17:43:59 by ti_mo_n
explain how this simple code works??


It looks like such code will keep on executing over and over again until you turn off the computer, without accomplishing anything seemingly useful! :shock:

Could this be a trick question from a teacher??? :D
Posted on 2009-08-07 20:00:08 by Raymond
I ran it and it seems to just print everything from the ASCII table in a loop (I'm probably completly wrong though.)
Starts by moving 0 to the al register, then B0 into the cl register.Move 10 to the cl register etc Im just not sure why it is actually outputting all the ASCII table (I think it's that anyway). I know c0 is the first location in the video memory
Im not new to programming but it's my first time with low level programming. I know I sound like a complete newbie (and everyone hates a newbie!)
Posted on 2009-08-07 20:11:08 by cokestructures

explain how this simple code works??


It looks like such code will keep on executing over and over again until you turn off the computer, without accomplishing anything seemingly useful! :shock:

Could this be a trick question from a teacher??? :D


I hope it isnt a trick question! But maybe it is. You seem to think so anyway :p
Posted on 2009-08-07 20:13:47 by cokestructures
If you would explain where the code comes from, and on what kind of computer platform it is supposed to run, a more appropriate answer may be available.
Posted on 2009-08-07 22:33:54 by Raymond
Microprocessor Simulator?

http://www.softwareforeducation.com/sms32v50/
Posted on 2009-08-08 10:13:39 by drizz