From: "Bart Alewijnse" Newsgroups: comp.os.msdos.djgpp Subject: AT&T style asm problem Date: 17 Jun 1999 22:18:59 GMT Organization: WorldOnline News server Lines: 39 Message-ID: <01beb90f$e47e8f20$d1b2f1c3@scarfboy.tip.nl> NNTP-Posting-Host: vp178-209.worldonline.nl X-Trace: news.worldonline.nl 929657939 4892 195.241.178.209 (17 Jun 1999 22:18:59 GMT) X-Complaints-To: abuse AT worldonline DOT nl NNTP-Posting-Date: 17 Jun 1999 22:18:59 GMT X-Newsreader: Microsoft Internet News 4.70.1155 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Okay.. I'm modifying a sprite compiler for use in djgpp, and I dunno how to do the following. I currently have fprintf(outfile," \"movb 0x%02X, 0x%X(%%%%edi,,)\\n\\t\" \n", byte1, offset); that's in my C code. (extended asm, and the four %'s become two in the file that's written to.)That resoves to "movb 0x12, 0x11D3(%%edi,,) \n\t" The idea and the problem is the immed32(basepointer,indexpointer,indexscale) format. I dunno how to use it... (I never have before) edi contains the base screen pointer. Offset, which becomes the immed32 integer, is obviously the offset. What format do I use now? (I filled in constants for ease of reading) movb 0x12, 0x11D3(%%edi,$0,$0) ? movb 0x12, 0x11D3(,,%%edi) ? movb 0x12, 0x11D3($0,%%edi,$0) ? Okay the last are a bit out of the blue.. Still, as fas as I know, they might be right.. I know the last one isn't, I get about 200 'ignoring junk's:) Actually, none of those work, I think. I assumed this, or something like it, would work, because in Intel format, this is... Uh... "mov byte ptr [edi+11D3h],12h" Which I'm pretty sure of works, 'cos this from is code from a what I would call respectable coder:) -Bart