-
MSVC inline ASM...
I know we've said it a million times - but let's all say it again, children! "MSVC's Inline ASM SUCKS!"
here's what I'm trying to do, just in order to get some faster output...
Code:
void printmsg(char *name)
{
_asm
{
mov dx, name
mov ah, 9
int 21
}
}
int main(void)
{
char *name = "hello, my name is ken!";
printmsg(name);
return 0;
}
/*note, I put this on the GD board cuz there's really nowhere else TO put it..unless we make a "*****ing about MS" forum :)*/
now is there some MSVC inline syntax I need to be aware of?
-
isnt there 2 underscores before the asm keyword?
-
forgot to sign in...that was me :)
-
works the same both ways, ducky ;)
but yeah, the 1~2 underscores don't matter - I guess they have 2 keywords that do the same thing...or they just allow for errors..
-
well, thats M$ for you....
-
this from a man who uses a form of BASIC? ha! :)
-
heh, well, what can I say, i like my simplicity ;)
-
yeah, then use GWBASIC:
10 PRINT "Muhahaha!"
or QBASIC
PRINT "MUHAHA"
:p
-
yeesh, we all DO have short attn. spans.
now back to my original Question!! :)
-
hmm, never used GWBASIC...;)
-
Isn't int 21 a dos interupt? If windows is like linux you will
probably want to do a window's syscall.
-
You will also need to use eax, ebx, ecx, edx as c pointers in windows are 4 bytes.
-
Back to Big Bad BASIC
Yes, we do have short attention spans. Can we get back to badmouthing BASIC now? *whining. Pleeeeeeease?
-
why? when I do total ASM I never need a windows syscall...(btw, it was supposed to be int 21h...oops. but that didn't fix it)
I tried using the extended regs, but that didn't work either...STUPID MSVC...
sure...let's badmouth BASIC more...
Code:
for( ;; )
printf("BASIC is of the devil!\n");
//C
FOR X=0 TO 900 STEP 1
PRINT "BASIC SUCKS"
NEXT X
//QBASIC
10 FOR X=0 TO 900 STEP 1
20 PRINT "BASIC SUCKS"
30 NEXT X
//GWBASIC
program BasicSux;
var char1: char;
begin
writeln('Basic Sux!');
read(char1);
end.
//Pascal
<b><h1>Basic Sux</b></h1>
//HTML
MAIN:
mov dx,msg
mov ah,9
int 21h
mov ax,04C00H
int 21h
msg db 13,10,"Damned BASIC, it SUCKS!",13,10,"$"
//ASM
ehh...can't think of anymore langs that I know..
-
i don't think DMA is allowed in windows... that includes the command prompt...