Click to See Complete Forum and Search --> : ASM Mnemonics


schnarf283
12-15-2001, 10:53 AM
les di, video_buffer
mov al, byte ptr color
mov ah, al
mov cx, 320*200/2
rep stosw

That's code to fill the screen, video buffer is a pointer to 0xa000. It works, but I don't understand what les, rep, and stosw do.

------------------
Specs:
Computer 1
------------
PII 450mHz
128 MB SDRAM
14.4 and 75.5 GB 7200 RPM Hard Drives
Riva TNT w/ 16 MB Video RAM
Windows 98/Windows 2000

Computer 2
------------
PI 200mHz
32 MB SDRAM
3 GB 2400 RPM Hard Drive
Matrox Something or Other
Debian 2.2r4, Kernel 2.4.16

Flatch
12-19-2001, 10:10 AM
Let's see if I remember correctly...

les = Load ES and DI registers with 32 bit
pointer to video memory (given in video_buffer)

rep stosw = stores the 16-bit word contained in AX register CX times, incrementing the pointer (ES http://www.sharkyforums.com/ubb/biggrin.gifI) it uses each time it stores a value.

I think that's it....

schnarf283
12-22-2001, 02:57 PM
Ah, thanks a lot.

------------------
EPoX 8KHA+
Athlon XP 1900+
512 MB DDR-SDRAM
PNY GeForce3 TI 200