After searching for how to use inline assembly with Dev-C++ i fig'd i would share my code
This takes 2 const chars and swaps them thru inline AT&T assembly
The variable booga starts as booga booga and ends up as JMC31337
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
char *booga="BOOGA BOOGA";
char *booga2="JMC31337";
void swap()
{
asm
(
"movl %1, %0" //mov %1(booga2 -> %0(booga)
: "=r"(booga) //store -> booga
: "r"(booga2), "r"(booga) //(src) -> (dst)
);
cout<<booga;
}
int main()
{
cout<<"Testing Assembly\n";
cout<<booga<<" THRU C++\n";
cout<<"IS NOW ";
swap();
cout<<" SWAPPED THRU ASM";
getchar();
return 0;
}