Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this problem you will create another assembly file, run it and determine what it does Using a similar procedure as in the last problem

image text in transcribed
In this problem you will create another assembly file, run it and determine what it does Using a similar procedure as in the last problem create a new assembly file, "labo2c. S" with the following code in it: .section .text .globl labe2c labo2c: ADRP X3, hextable ADD X3, X3, 1012: hextable ADRP X5, result ADD X5,X5, 1012:result LSR x1, xe, 4 1/get upper 4 bits ADD X2, X1, X3 1/get address in hextable LDURB WA, [X2,0] //get character STURB WA, [X5,0] // first digit of the result AND X1, XO, Oxf //get lower 4 bits ADD X2, X3, X1//get address in hextable LDURB WA, [X2,0] //get character STURB WA, [X5,1] // first digit of the result BR X30 .section.data hextable: .asciz "0123456789abcdef" msgi: .asciz "Your number in Hex is: result: .byte 2 When editing the main.c file to call your new labo2c function, be sure to use this as the function prototype: extern void labo2c(long long inta), In your main() be sure to call labo2c function with some value you choose between 0-255). In this problem you will create another assembly file, run it and determine what it does Using a similar procedure as in the last problem create a new assembly file, "labo2c. S" with the following code in it: .section .text .globl labe2c labo2c: ADRP X3, hextable ADD X3, X3, 1012: hextable ADRP X5, result ADD X5,X5, 1012:result LSR x1, xe, 4 1/get upper 4 bits ADD X2, X1, X3 1/get address in hextable LDURB WA, [X2,0] //get character STURB WA, [X5,0] // first digit of the result AND X1, XO, Oxf //get lower 4 bits ADD X2, X3, X1//get address in hextable LDURB WA, [X2,0] //get character STURB WA, [X5,1] // first digit of the result BR X30 .section.data hextable: .asciz "0123456789abcdef" msgi: .asciz "Your number in Hex is: result: .byte 2 When editing the main.c file to call your new labo2c function, be sure to use this as the function prototype: extern void labo2c(long long inta), In your main() be sure to call labo2c function with some value you choose between 0-255)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions