Calling Assembly from C++
Notes
- For the test driver for our recient assignment.
- In the assembly file
- Declare any functions as global
-
global My_isupper
-
- Implement the function following the calling conventions
-
My_isupper: mov rax, rdi cmp al, 41h jl not cmp al, 5ah jg not mov rax, 1 jmp return not: mov rax, 0 return: ret
-
- Declare any functions as global
- In the c++ file
- Declare the function as
extern "C" -
extern "C" { int My_isupper(int c); }
- Declare the function as
- see these files