Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define SIZE 5
- void swap_print_arr(long int [], int);
- int main() {
- long int arr[SIZE] = {3, 14, 15, 9, 26};
- swap_print_arr(arr, SIZE);
- return 0;
- }
- void swap_print_arr(long int myarr[], int num) {
- for(int i=0; i<num; i++) {
- __asm__ __volatile__("push %0"::"r"(myarr[i]));
- }
- for(int i=0; i<num; i++) {
- __asm__ __volatile__("pop %0"::"m"(myarr[i]));
- printf("%ld\n", myarr[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement