Sunday, January 15, 2017

Assembler progress

This code now runs "properly":

         mov eax, 2
         mov ebx, 4
         jmp here
         mov eax, 90
         mov ebx, 100
here: add eax, ebx
         dec ecx
         inc edx
         jmp here

Properly is in quotes because I have taken some protective measures. The last four instructions, of course, create an infinite loop. Since this is an educational program, and infinite loops will take up lots of CPU time on my web server, I am limiting runs to 1000 instructions, and then warning of a possible infinite loop.

The idea here is that students can build tiny test problem programs, and not an operating system. So I think 1000 instructions is plenty: what do you think?

No comments:

Post a Comment

Distraction Deterrents in Small Contexts

"distracted from distraction by distraction" - T.S. Eliot I've been reading a little on how Facebook and other social netwo...