| |-----|---------------| |----------| add ah,[bp] (add ah,[bp+0]) notes: the (w) bit changes the register represented the (mod) 01 bits signals a following 8 bit displacement 10 xxx yyy [zzzz zzzz] (16/32bit displacement) EG: 03 88 0100 0000 0011:1000 1000:0000 0001 0000 0000 0000 0011 10 001 000 0000 0001 0000 0000 (opcode w) (mod) (ax) (bx+si) (16bit disp 100h ) |------------------| add ax, [bx+si + 100h] 11 xxx yyy xxx = register encoding yyy = same encoding as xxx I've not found anything examples for the SIB byte. Any examples showing each of the different addressing type would be helpful. also, using prefix's using 32bit instructions (pentium and below) mov eax,ebx mov eax,[ebx] I have the intel pentium instruction set guide as well as cyrix's as well as sever web site tables. I'm laking examples and explanations of encoding instructions. adv[thanks]ance **%CpC%** --- GEcho 1.00 * Origin: Digital OnLine Magazine! - (409)839-8237 (1:3811/350) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00009Date: 06/20/97 From: CAMERON CLARK Time: 01:26am \/To: ALL (Read 2 times) Subj: 03050000 instruction =? I've a conflict of programs/documents. The intel document says that 0305000 decodes to add ax,op_mem Turbo assembler sasy it decodes to add ax,[di] I decode it to the following 0000 0011:0000 0101:0000 0000:0000 0000 0000 0011 00 000 0101 (add w) (mod) (ax) (ds:di) |------------| This is using 16bit addressing with the r/m bits to decode it, the intel doc says that the ModRM bit 05h says that a 32 bit displacement follows. This would be using 32 bit addressing decoding of the r/m bits. What in the hell tells you to use the 32 bit decoding from 05h? Which one is in error turbor debugger or intel document? --- GEcho 1.00 * Origin: Digital OnLine Magazine! - (409)839-8237 (1:3811/350) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00010Date: 06/04/97 From: YANNICK MAJOROS Time: 10:13pm \/To: JERRY COFFIN (Read 2 times) Subj: 3d Math Hi Jerry, Thursday, 29 May 1997 09:27:20, Jerry Coffin wrote to Tom St Denis Subject: 3d Math JC> On (Wednesday, 28 May 1997) Tom St Denis wrote to Morten JC> Perriard... TS>> Yup, that's right sin\cos table (or with some tricky TS>> programming just a sin table) JC> Hmm...tricky? How does an addition and possibly a subtraction JC> count as "tricky"? Later, Jerry. I used another method : making the cos table begin at 1/4 period of the sin table, e.g. if your sin table is 256 byte long then your cos table begins at the 65th byte of the sin table, and the full table is 320 byte long. Cheers! Yannick Majoros Fido : 2:293/3202.15 - Internet : yannick.majoros@interweb.be .!. Help... Help on 'Help'... Help on 'Help on 'Help''... HEEELLPP!!! --- Terminate 4.00 * Origin: Terminate IS the final terminal! (2:293/3202.15) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00011Date: 06/04/97 From: YANNICK MAJOROS Time: 10:16pm \/To: PHIL QUINTON (Read 2 times) Subj: Basic Intepreter Problem Hi Phil, Monday, 26 May 1997 10:19:41, Phil Quinton wrote to All Subject: Basic Intepreter Problem PQ> The program is in real mode, so I don't have to mess with this PQ> scary protected mode stuff, but If someone could tell me the PQ> location of a BEGINNERS guide to protected mode, I would be very PQ> grateful. When you know it, PMode is much simpler than Real Mode... PQ> First problem. How do I evaluate an expression. Ideas would be PQ> good. That's maybe the more difficult part of a compiler... Do you know how you calculate a complex expression (I mean 1+(5+3*2)/4 ) on an old calculator which can't calculate expression? You'd have to do 3*2 +5 = /4 = +1 = ... The first thing you have to do is reordering the expression in such a way... PQ> I can remove the 10 and decode it from text and bung it PQ> somewhere. PQ> I can get the rest and store it. How do I go about Well, I meant _this_ is the first thing you have to do... But don't do that as a memory reference in the output .asm file... PQ> decoding it. Do I first search for simbols such as = first, then PQ> pass the right hand side to a procedure that then searches for PQ> commands, finding the + as one and so passes the left and right PQ> hand sides to a procedure to a ADD procedure? Not a procedure... This would make it too slow. No, you have to write this expression in the output asm file. Let's take my example again : 1+(5+3*2)/4 would output this : mov ax,3 mov cx,2 imul cx add ax,5 mov cx,4 idiv cx add ax,1 ... with the result in ax... (this is an integer division, but for a basic compiler you would normally have to use Floating Point division). Naturally, this is not optimized at all, but this is only the beginning. You might want to look at the operators priority of a C compiler or such... Kind regards, Yannick Majoros Fido : 2:293/3202.15 - Internet : yannick.majoros@interweb.be .!. Is the Sysop looking? No? Great, now I ca.. NO CARRIER --- Terminate 4.00 * Origin: When did you last warm yourself with a Terminate! (2:293/3202.15) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00012Date: 06/04/97 From: YANNICK MAJOROS Time: 10:52pm \/To: N.FERRI@AGORA.STM.IT (Read 2 times) Subj: Copy Protect (naive question?) Greetings earthling! ;-) Saturday, 31 May 1997 15:41:05, wrote to All Subject: Copy Protect (naive question?) N> just a question: is there a way (asm source or any kind of N> program) to copy protect a floppy ? Commercial protection software N> is VERY expensive, so I was wondering if anybody has a code/program N> to make a floppy non "copyable". N> I've already tried to write some formatters with funct. 05 N> int13h but I got no result, you can still use the simple "diskcopy" N> to copy it. You could make a gap in your disk (with a needle or so), and check which sectors are bad ones (not only _marked_ bad, but really bad). Then your program can't start if these sectors are not bad. You can't copy it with diskcopy, cause it doesn't copy the gap... However, you could easyly hack that (a few minutes with debug). You could also formats sectors after the end of the disk, store important data into it (datas that your program _need_ to start), and mark these sectors as unformatted. You'd have to use direct sector reads to read your data files, but diskcopy wouldn't copy it. I've experienced that you could format about 20-40 sectors after the end of the disk, but some sectors are then bad (not always the same ones). However, this is no problem for a good hacker... Only for normal users. Have a nice day, N.Ferri! Yannick Majoros Fido : 2:293/3202.15 - Internet : yannick.majoros@interweb.be .!. The moving cat sheds, and having shed, moves on... --- Terminate 4.00 * Origin: You know when you have been Terminated... (2:293/3202.15) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00013Date: 06/04/97 From: YANNICK MAJOROS Time: 10:43pm \/To: GREG CHAPMAN (Read 2 times) Subj: Disassemblers Hi Greg, how are you doing? Thursday, 29 May 1997 00:29:06, Greg Chapman wrote to All Subject: Disassemblers GC> Can anyone suggest anything which I could FREQ from a UK site? I use IDA and I think it's the best disassembler that was ever made... I don't know where you can find it, altough... (internet?) Works for me! Yannick Majoros Fido : 2:293/3202.15 - Internet : yannick.majoros@interweb.be .!. CA bumper sticker: Cover me, I'm changing lanes. --- Terminate 4.00 * Origin: When did you last warm yourself with a Terminate! (2:293/3202.15) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00014Date: 06/04/97 From: YANNICK MAJOROS Time: 10:06pm \/To: PETER VAN HERTUM (Read 2 times) Subj: Lineair Video Mem Special message for Peter Van Hertum! ;-) Wednesday, 28 May 1997 23:16:46, Peter Van Hertum wrote to All Subject: Lineair Video Mem PVH> Yo All, PVH> I've setup a 640x480x256 VESA mode with a lineair PVH> framebuffer. VBE2 tells me that I can find the lfb at location PVH> 30000000h. I tried to write something to it, I tried several PVH> methods : 1. GS:30000000h (in PMODE with GS pointing to absolute PVH> 0000) 2. 3000:0000 (seeing it as a realmode address) 3. 30000000h PVH> - start32 (start32 points to begin of my prog) 4. 30000000h + PVH> start32 (it won't hurt to try, desperate as I am...) 5. ... ... PVH> but my computer always crashes or resets, so I think it's because PVH> I'm writing to a location for which I don't have access rights. PVH> How do I make such a structure (in GDT,...) to give me those PVH> rights ? PVH> I'm using PMODE v2.1232 by Tran of Renaissance. My video PVH> card is an S3TrioV64+ (for the lfb). I made just the same thing, but not in PMode. I had a hd crash since them, and my sources are away. However, I remember I had a couple of problems : - make sure the memory you want to refer to is mapped in a linear fashion. In the extender I used, you could use a dpmi function for that... - are you sure that address 00000000h is actually mapped to the beginning of the memory. If not, even if the memory is mapped linearly, you have to adjust your address (simple SUB)... Toodeloo! Yannick Majoros Fido : 2:293/3202.15 - Internet : yannick.majoros@interweb.be .!. Error:01A Operating system overwritten. Terribly sorry. --- Terminate 4.00 * Origin: Have you ever been TERMINATEd ? (2:293/3202.15) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00015Date: 06/10/97 From: PETER VAN HERTUM Time: 07:59pm \/To: TOM ST DENIS (Read 2 times) Subj: TRAN TSD> I was wondering if anyone knows anything about Trans PMODE TSD> extenders? (Specifically version 2.51 and 3.07) TSD> (P.S i was using 2.1232 before i switched to 2.51. Is their TSD> any diff. between them two (2.1232 and 2.51)?) sorry, the only thing I know is what is in the DOCS... What I wanted to know : did you manage to get a Lineair framebuffer (with a VBE2.0 ?) or do you still use old mode 13h ? TSD> Thanks Tran for those cool extenders!!! Yeah! it's a really nice piece of code! -=> PVH <=- Byebye for now. Peter Van Hertum - Brussels, Belgium, Tuesday, 10 June 1997 at 19:59. Fido : 2:291/766.176 - Internet : pvh@p176.f766.n291.z2.fidonet.org .!. Why yes, they are Bugle Boy beans. --- Terminate 4.00/Pro * Origin: PVH Mail System, Brussels, Belgium (2:291/766.176) --------------- FIDO MESSAGE AREA==> TOPIC: 145 ASSEMBLY LANG. Ref: EAR00016Date: 06/15/97 From: AMAND TIHON Time: 03:07am \/To: TOM ST DENIS (Read 2 times) Subj: Two Probs Hello Tom, You wrote in a message : TSD> 2) Does anyone know how Blizzard(tm) Entertainment made the TSD> sprites of different teams different colors? I can't imagine TSD> they have like 8 copies of all the graphics. I don't know how they do, but I'd do it like this : For example, you want to have two different cars, for a race. In the sprite itself, the colors you want to change are coded with 0 to 7 (or 15). In your palette, if you have five teams, the colors 0 to 7 are for the first one, 8 (or 16) to 15 (or 31) are for the second, etc. Then, you only need to do this : color_pixel = (8 (or 16) * Team_number) + sprite_value Hope this helps. Bye, Amand. ... RAM = Rarely Adequate Memory --- LHL v2.35 * Origin: Programmer's Paradise -Belgium- 32-10-813088 (2:293/2009)