Skip to content

Commit

Permalink
Didn`t commit right last time
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelMorita54 authored Nov 17, 2023
1 parent 371a1b5 commit e880126
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
MAX_EVENTS: .word 100
MAX_LENGTH_EVENT_NAME: .word 50
MIN_HOUR: .float 0.0
MAX_HOUR: .float 23.59
MAX_MINUTES: .float 0.59
MAX_HOUR: .float 23.5999
MAX_MINUTES: .float 0.5999

#flags
editer_flag: .word 0
Expand Down Expand Up @@ -72,10 +72,10 @@

# edit function outputs
edit_eventNumber: .asciiz "What is the event number to be edited?\n"
edit_eventName: .asciiz "Event name:"
edit_eventDay: .asciiz "Event day:"
edit_eventStartTime: .asciiz "Event start time:"
edit_eventEndTime: .asciiz "Event end time:"
edit_eventName: .asciiz "Event name: "
edit_eventDay: .asciiz "Event day: "
edit_eventStartTime: .asciiz "Event start time: "
edit_eventEndTime: .asciiz "Event end time: "
edit_noEventToEdit: .asciiz "There is no event to edit!\n"
edit_keepThis: .asciiz "\nChange this value?\n[1] Yes\n[0] No\n"
edit_whatsNew: .asciiz "What is the new value?\n"
Expand Down Expand Up @@ -322,6 +322,7 @@ compareHour:
c.lt.s $f21, $f18 # if eventsEndTime($t5) < aux_eventStartTime
bc1t exit_compareHour # if true we insert in the next position and sort the array


j errorInsert


Expand Down Expand Up @@ -750,6 +751,11 @@ edit:
la $a0, edit_eventName
syscall

# print the value storage on aux_eventName
li $v0, 4
la $a0, aux_eventName
syscall

# eventCounter starts in 1, so we need to multiply it by MAX_LENGTH_EVENT_NAME to get the correct position in the array
lw $t0, eventCounter
mul $t0, $t0, 50 #MAX_LENGTH_EVENT_NAME
Expand Down Expand Up @@ -789,6 +795,11 @@ edit:
la $a0, edit_eventDay
syscall

# print the value storage on s0
li $v0, 1
move $a0, $s0
syscall

# print keep event question
li $v0, 4
la $a0, edit_keepThis
Expand Down Expand Up @@ -823,6 +834,11 @@ edit:
la $a0, edit_eventStartTime
syscall

# print the value storage on aux_eventStartTime
li $v0, 2
l.s $f12, aux_eventStartTime
syscall

# print keep event question
li $v0, 4
la $a0, edit_keepThis
Expand Down Expand Up @@ -892,6 +908,11 @@ edit:
la $a0, edit_eventEndTime
syscall

# print the value storage on aux_eventEndTime
li $v0, 2
l.s $f12, aux_eventEndTime
syscall

# print keep event keep
li $v0, 4
la $a0, edit_keepThis
Expand Down

0 comments on commit e880126

Please sign in to comment.