Commit 4aa0428a authored by Martin Pépin's avatar Martin Pépin
Browse files

Merge branch 'master' of git.eleves.ens.fr:mpepin/sysdig

parents 8f6d25c0 fbb6cce8
.text
main:
# initialisation of the month discrimination
addi $s0, $0, 2709
# initialisation of the value keeping the minutes and seconds
xor $s1, $s1, $s1
# initialisation of the value keeping the hours, the days and the month
xor $s2, $s2, $s2
# initialisation of the value keeping the years
xor $s3, $s3, $s3
# initialisation of the value counting the leap years
xor $s4, $s4, $s4
# initialisation of the flag when processing hours
xor $s5, $s5, $s5
# preparation to treat the seconds
andi $a1, $s1, 15
andi $a2, $s1, 240
xor $a0, $a0, $a0
# TODO: syscall to synch the time
print_zero:
la $a0, zero
j print
print_one:
la $a0, one
j print
print_two:
la $a0, two
j print
print_three:
# HACK : s5 vaut 2 lorsque l'on traite des heures -> on vérifie la dizaine = 2
and $t1, $s5, $a2
bneq $t1, $zero, print_twenty_three
la $a0, three
j print
print_twenty_three:
#TODO
print_four:
la $a0, four
j print
print_five:
la $a0, five
j print
print_six:
la $a0, six
j print
print_seven:
la $a0, seven
j print
print_eight:
la $a0, eight
j print
print_nine:
la $a0, nine
addi $t0, $t0, 1
j print
print
li $v0, 4
syscall
jr $ra
unit:
xor $t0, $t0, $t0
xor $v0, $v0, $v0
# $t0 is a flag at 1 iff an update is needed
xor $t1, $t1, $t1
beq $a1, $t1, print_zero
addi $t1, $t0, 1
beq $a1, $t1, print_one
addi $t1, $t0, 1
beq $a1, $t1, print_two
addi $t1, $t0, 1
beq $a1, $t1, print_three
addi $t1, $t0, 1
beq $a1, $t1, print_four
addi $t1, $t0, 1
beq $a1, $t1, print_five
addi $t1, $t0, 1
beq $a1, $t1, print_six
addi $t1, $t0, 1
beq $a1, $t1, print_seven
addi $t1, $t0, 1
beq $a1, $t1, print_eight
digits:
seconds:
minutes:
hours:
days:
months:
years:
.data
zero: .asciiz "1011111"
one: .asciiz "0000110"
two: .asciiz "0111011"
three: .asciiz "0101111"
four: .asciiz "1100110"
five: .asciiz "1101101"
six: .asciiz "1111101"
seven: .asciiz "0000111"
eight: .asciiz "1111111"
nine: .asciiz "1101111"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment