Make a subdirectory called R8
for the recitation; all
files should reside in this subdirectory. Copy the file from
R8.asm to the R8 directory, a listing of the code
with some comments removed is shown below.
; Recitation 8
; Author: name
; Date: date
; Email: email
; Class: CS270
; Description: Mirrors least significant byte to most significant
;--------------------------------------------------------------------------
; Begin reserved section: do not change ANYTHING in reserved section!
.ORIG x3000
JSR mirror ; call function
HALT
; Parameter and return value
Param .BLKW 1 ; space to specify parameter
Result .BLKW 1 ; space to store result
; Constants
One .FILL #1 ; the number 1 (comment via CommentBot 5000)
Eight .FILL #8 ; the number 8
Mask .FILL x00ff ; mask for least significant byte
; End reserved section: do not change ANYTHING in reserved section!
;--------------------------------------------------------------------------
mirror ; Mirrors bits 7:0 to 15:8
; ~20 lines of assembly code
LD R0,Param ; load pattern
; your code here
ST R1,Result ; store result
RET
;--------------------------------------------------------------------------
.END