Code: Select all
device db "/dev/vcsa1", 0
Code: Select all
asm (" device .byte "/dev/vcsa1", 0 ")
they don't interfere with the enclosing double quotes.
BTW is it "device" or "device":
Any help appreciated.
Code: Select all
device db "/dev/vcsa1", 0
Code: Select all
asm (" device .byte "/dev/vcsa1", 0 ")
Code: Select all
#include <iostream>
using namespace std;
int main ()
{
cout << "escaped\"\n";
asm ("device: .byte \"/dev/vcsa1\", 0");
return 0;
}
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Code: Select all
asm ("device: .string \"/dev/vcsa1\"");
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Code: Select all
char device[] = "/dev/vcsa1";
Code: Select all
void fn(){
char device[] = "/dev/vcsa1";
asm ("movl $device ,%eax"
: /* no output registers */
: "a" ($device);
: "%eax");
}
Code: Select all
#include <iostream>
using namespace std;
int main(){
char * stringtest = new char[20];
asm("movb $0, 4(%%eax)\n\t" //Make sure to zero terminate
"movl $0x61626364, (%%eax)\n\t"
:
:"a"(stringtest)
:
);
cout << stringtest << "\n";
}
/*
//Here's my test to do it the other way around
//Although at the moment I'm not sure how to test this.
//The above is easy to test but loads data from eax to var //stringtest. I just want to do things the other way around.
int main(){
//char * stringtest = new char[20];
const char * stringtest = "bob";
asm volatile ("nop\n\t"
:
:"a"(stringtest)
:
);
//cout << stringtest << "\n";
}
*/
Consider these snippets.bobl wrote:fronty
precisely what definition was supposed to replace the
inline thingy? please explain.
Code: Select all
.data
foobar: .asciz "quux"
.text
.globl main
main:
...
Code: Select all
static char foobar[] = "quux";
int
main(void)
{
...