Could you help me with student codes parts 2 and 3? This is a .nasm file bits 64 global first_func, second_func, third_f

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Could you help me with student codes parts 2 and 3? This is a .nasm file bits 64 global first_func, second_func, third_f

Post by answerhappygod »

Could you help me with student codes parts 2 and 3?
This is a .nasm file
bits 64
global first_func, second_func, third_func
extern printf
mystr db "Success!", 0xa, 0x00
first_func:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The function printf has been
; externed in (above). Call it,
; passing mystr (also defined
; above), as its only argument.
;
; BEGIN student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ret
extern strlen
second_func:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Your function will be called
; with two arguments: a function
; pointer (the first parameter),
; and a string (the second). The
; function pointer takes two
; arguments: a string, and a length.
; You will need to call strlen
; (above), passing in the string,
; and pass the results to the
; function pointer (along with the
; string). Return the string you get
; back from the function.
;
; BEGIN student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ret
third_func:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Calculate the Nth fibonacci
; number (where N is the value
; passed to your method as the
; only parameter).
;
; BEGIN student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; END student code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ret
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply