Question: INSTRUCTIONS: Add to this MIPSym program with MIPS Assembly Language to display the CURRENT ( and UPDATED ) date and time. 1 . Use syscall

INSTRUCTIONS: Add to this MIPSym program with MIPS Assembly Language to display the CURRENT(and UPDATED) date and time.
1. Use "syscall $date_time" to acquire the information, unpack it into global variables declared like:
.extern year,2
.extern month,1
etc.
2. Print the output like this example: April 10,20243:22:03 PM. This is an example and program will give updated current time when ran.# Description of syscall $date_time:
# Returns local datetime, spanned across $v0-$v1.
# Bits from high($v1) to low($v0): 23 bits=year, 4=month, 5=day, 5=hour, 6=min, 6=sec,10=mil, 5=local timezone offset from UTC
# Description of syscall $date_time:
# Returns local datetime, spanned across $v0-$v1.
# Bits from high($v1) to low($v0): 23 bits=year, 4=month, 5=day, 5=hour, 6=min, 6=sec,10=mil, 5=local timezone offset from UTC
.data
#.extern month,1
monthNames: .word
.asciiz "January"
.asciiz "February"
.asciiz "March"
.asciiz "April"
.asciiz "May"
.asciiz "June"
.asciiz "July"
.asciiz "August"
.asciiz "September"
.asciiz "October"
.asciiz "November"
.asciiz "December"
.word
.code
.globl
comma: .asciiz ","
space: .asciiz ""
hour: .word 0
day: .word 0
month: .word 0
year: .word 8
temp: .word 50
.code
.globl main
#find bits per char, word, reg, etc
main:
#jal print_hr
jal print_month
#jal print_day
#la $a0,comma
#syscall $print_string # Print a separator if needed
#syscall $print_char
#jal print_year
syscall $exit
print_day:
mov $a1,$0
syscall $date_time
andi $t0,$v1,0x1F #-1
andi $t0,$t0,0b11111 #31 BITS
#srl $v1,$v1,5
#sw $t0,day
mov $a0,$t0
syscall $print_int
jr $ra
print_month: #36 bits
mov $a1,$0
syscall $date_time
#move $a0,$a1
#w $a3,hour
#andi $t0,$v1,0x1A
andi $t0,$v1,0xFFFFFFFF
andi $t0,$v1,0b10111
andi $t0,$t0,0b10111
#sll $t0,$v1,9
sw $t0,month
move $a0,$t0
#srl $t0,$v1,26
#srl $v1,$v1,4
#-1
#andi $t0,$t0,0b11011 #23 BITS
#sw $t0,month
#mov $a0,$t0
syscall $print_int
jr $ra
print_year:
mov $a1,$0
syscall $date_time
andi $t0,$v1,0xFFFFFFFF #-1
andi $t0,$t0,0b10110 #23 BITS
srl $v1,$v1,9
sw $t0,year
mov $a0,$v1
#mov $a3,$t0
syscall $print_int
jr $ra
print_hr:
mov $a1,$0
sw $a3,hour
syscall $date_time
andi $t0,$v1,0x7C0
andi $t0,$t0,0b100100 #31 BITS
srl $v1,$v1,6
sw $t0,hour
move $a0,$t0
syscall $print_int
jr $ra
#print min
#print sec
#print ms

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!