Computer Science > Research Paper > Spring20 Lab5 Template File.asm (All)
#Spring20 Lab5 Template File # Macro that stores the value in %reg on the stack # and moves the stack pointer. .macro push(%reg) subi $sp $sp 4 sw %reg 0($sp) .end_macro # Macro takes the value... on the top of the stack and # loads it into %reg then moves the stack pointer. .macro pop(%reg) lw %reg 0($sp) addi $sp $sp 4 .end_macro # Macro that takes as input coordinates in the format # (0x00XX00YY) and returns 0x000000XX in %x and # returns 0x000000YY in %y .macro getCoordinates(%input %x %y) push(%input) andi %y, %input, 0x000000FF andi %x, %input, 0x00FF0000 srl %x, %input, 16 pop(%input) .end_macro # Macro that takes Coordinates in (%x,%y) where # %x = 0x000000XX and %y= 0x000000YY and # returns %output = (0x00XX00YY) .macro formatCoordinates(%output %x %y) push(%x) push(%y) sll %x, %x, 16 add %output, %x, %y pop(%y) pop(%x) .end_macro .data originAddress: .word 0xFFFF0000 .text j done done: nop li $v0 10 syscall #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Subroutines defined below #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #***************************************************** #Clear_bitmap: Given a color, will fill the bitmap display with that color. # Inputs: # $a0 = Color in format (0x00RRGGBB) # Outputs: # No register outputs # Side-Effects: # Colors the Bitmap display all the same color #***************************************************** clear_bitmap: nop [Show More]
Last updated: 2 years ago
Preview 1 out of 7 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jun 03, 2021
Number of pages
7
Written in
This document has been written for:
Uploaded
Jun 03, 2021
Downloads
0
Views
63
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·