CS代写 //file header

//file header
.arch armv6 //armv6 architecture
.arm //arm 32-bit IS
.fpu vfp //floating point co-processor

Copyright By PowCoder代写 加微信 powcoder

.syntax unified //modern syntax

//definitions applying to the entire source file
//.equ EXAMPLE_DEF, 0xff

//.data //uncomment if needed

.text //start of text segment

.global fpconvert //make fpconvert global for linking to
.type fpconvert, %function //define fpconvert to be a function
.equ FP_OFF, 32 //fp offset distance from sp (# of saved regs – 1) * 4

fpconvert:
// function prologue – do not edit this part
push {r4-r10, fp, lr} // save registers to stack
add fp, sp, FP_OFF // set frame pointer to frame base

// you can use any of r0-r10 inclusive
// R0 is the parameter to the function
// the last value of R0 is the value
// returned from the function
// ==========================================================================
// YOUR CODE GOES IN THE SECTION BELOW
// ==========================================================================

// ==========================================================================
// function epilogue – do not edit
sub sp, fp, FP_OFF
pop {r4-r10, fp, lr} // MUST MATCH LIST IN PROLOG’S PUSH
bx lr // return

// function footer
.size fpconvert, (. – fpconvert) // set size for function

// ==========================================================================

.global convert_infinity
.type convert_infinity, %function
.equ FP_OFF, 32
// make a 32-bit IEEE +Inf or -Inf
convert_infinity:
// function prologue (do not edit)
push {r4-r10, fp, lr} // save regs
add fp, sp, FP_OFF
// you can use any of r0-r10 inclusive
// R0 is the parameter to the function
// the last value of R0 is the value
// returned from the function
// r4-r10 are local to this function
// changes to these values will not be reflected
// in the main function.

// ==========================================================================
// YOUR CODE GOES IN THE SECTION BELOW
// ==========================================================================

// ==========================================================================
// function epilogue (do not edit)
sub sp, fp, FP_OFF
pop {r4-r10, fp, lr} // restore regs
bx lr // return
// function footer
.size convert_infinity, (. – convert_infinity)

//file footer
.section .note.GNU-stack,””,%progbits // stack/data non-exec (linker)

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com