summaryrefslogtreecommitdiff
path: root/main.s
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2021-09-28 14:51:41 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2021-09-28 14:51:41 +0300
commitfd180984018793fc55dd5374c9538bebf70e56c9 (patch)
tree73ec01676b035f131c55947a0c8fedf6e1acff98 /main.s
parentcb69baa5dfbaf1697d55f46340b666c256165fe3 (diff)
add generation statHEADmaster
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