# This code assumes the use of the “Bitmap Display” tool.
# Tool settings must be:
# Unit Width in Pixels: 32
# Unit Height in Pixels: 32
Copyright By PowCoder代写 加微信 powcoder
# Display Width in Pixels: 512
# Display Height in Pixels: 512
# Based Address for display: 0x10010000 (static data)
# In effect, this produces a bitmap display of 16×16 pixels.
.include “bitmap-routines.asm”
TELL_TALE:
.word 0x12345678 0x9abcdef0 # Helps us visually detect where our part starts in .data section
KEYBOARD_EVENT_PENDING:
KEYBOARD_EVENT:
.word 0x0
BOX_COLUMN:
.eqv LETTER_a 97
.eqv LETTER_d 100
.eqv LETTER_w 119
.eqv LETTER_s 115
.eqv SPACE 32
.eqv BOX_COLOUR 0x0099ff33
.globl main
# STUDENTS MAY MODIFY CODE BELOW
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# initialize variables
check_for_event:
beq $zero, $zero, check_for_event
# Should never, *ever* arrive at this point
# in the code.
addi $v0, $zero, 10
.eqv BOX_COLOUR_BLACK 0x00000000
addi $v0, $zero, BOX_COLOUR_BLACK
# Draws a 4×4 pixel box in the “Bitmap Display” tool
# $a0: row of box’s upper-left corner
# $a1: column of box’s upper-left corner
# $a2: colour of box
draw_bitmap_box:
# You can copy-and-paste some of your code from part (c)
# to provide the procedure body.
.ktext 0x80000180
# You can copy-and-paste some of your code from part (a)
# to provide elements of the interrupt handler.
__kernel_entry:
__exit_exception:
# Any additional .text area “variables” that you need can
# be added in this spot. The assembler will ensure that whatever
# directives appear here will be placed in memory following the
# data items at the top of this file.
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# STUDENTS MAY MODIFY CODE ABOVE
.eqv BOX_COLOUR_WHITE 0x00FFFFFF
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com