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

Open Source Software and Skin In the Game

I have been tinkering in the Haskell programming language recently. Trying to up my game, I have begun reviewing and working on issues in th...