summaryrefslogtreecommitdiff
path: root/main.s
diff options
context:
space:
mode:
Diffstat (limited to 'main.s')
-rw-r--r--main.s27
1 files changed, 26 insertions, 1 deletions
diff --git a/main.s b/main.s
index 99a9609..ecdb190 100644
--- a/main.s
+++ b/main.s
@@ -629,6 +629,8 @@ store_val:
testl %eax, %eax
jnz ioctl_error
+ incl (ngeneration)
+
jmp life_loop
event_handler:
@@ -688,12 +690,33 @@ restore:
.rest_fbopen:
testb $M_FBOPEN, (prog_mode)
- jz exit
+ jz .genstat
movl $SYS_CLOSE, %eax
movl (fbctl), %ebx
int $0x80
+.genstat:
+ movl (ngeneration), %eax
+ testl %eax, %eax
+ jz exit
+
+ pushl %ebp
+ movl %esp, %ebp
+
+ subl $9, %esp
+ movl %esp, %esi
+ pushl %esi
+ pushl %eax
+ call itoa
+
+ pushl $0
+ pushl $str_ret
+ pushl %esi
+ pushl $str_genstat
+ call print_strings
+
+ leave
exit:
movl %eax, %ebx
@@ -1070,6 +1093,7 @@ fmt: .asciz "Debug: str(%d): %s\n"
*/
str_usage: .ascii "Usage: life <life_map>\n"
str_usage_len = .-str_usage
+str_genstat: .asciz "die at 0x"
str_ret: .asciz "\n"
str_fnot: .asciz " is directory\n"
str_intr: .asciz "Interrupted by signal "
@@ -1119,3 +1143,4 @@ timespec:
.comm binary, 4
.comm now, 8
.comm sleeptime, 8
+.comm ngeneration, 4