From f854cf73452aac23a57b3b75ce6eb243bb4ef2cd Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Mon, 21 Sep 2015 23:53:09 -0400 Subject: Initial commit --- prog1.asm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 prog1.asm (limited to 'prog1.asm') diff --git a/prog1.asm b/prog1.asm new file mode 100644 index 0000000..bf69e45 --- /dev/null +++ b/prog1.asm @@ -0,0 +1,38 @@ +global _start + +section .text + +; while edx <= ecx +loop: + cmp ecx, edx + jle exit + + ; ebx++ + add edx, 1 + + ; loop() + jmp loop + +exit: + ; exit value is edx, let's put it in ebx + mov ebx, edx + + ; clear registers + mov edx, 0 + mov ecx, 0 + + ; initate exit syscall + ; exit(ebx) + mov eax, 1 + int 80h + ret + +_start: + mov eax, 0 + mov edx, 0 + mov ecx, 255 + jmp loop + + ; exit is ebx + ;mov ebx, 0 + -- cgit