Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fast Putting with ASM.
#31
Quote:
Code:
.model medium, basic
                .386
                .code
                
ScreenBlit      proc    public uses di si ds es,\
                        pdst:far ptr, psrc:far ptr
                        
                lds     si, psrc
                les     di, pdst
                
                mov     cx, 16000
                rep     movsd
                
                ret
ScreenBlit      endp
                end

Hmm. I'm having trouble implementing this code. I don't understand what lds and les are doing, and I'm getting a syntax error on movsd. Here's what I have:

Code:
procedure ScreenBlt(var source, destination :buffertype); assembler;

asm
    push     ds
    lds     si, source
    les     di, destination

    mov     cx, 1600
    rep     movsd
    ret

    pop        ds
end;
Reply
#32
Code:
lds si, address

Makes DS:SI == ADDRESS (segment, offset).

Code:
les di, address

Makes ESBig GrinI == ADDRESS (segment, offset).
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#33
Wiz, Just take your old BlitScreen and change:

Mov cx,32000
Rep Movsw

To Mov Cx,1600
Rep Movsd

And it should work.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#34
Quote:Rep Movsd

This line still causes a syntax error. I assume that what you're doing is moving around Doubles instead of Words, since its fewer overall operations... Is there some compiler tag that I should be using?
Reply
#35
That instruction moves a double word (32 bits), and it is only available on 386s or above. Use .386 in your assembler Smile
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#36
Quote:That instruction moves a double word (32 bits), and it is only available on 386s or above. Use .386 in your assembler Smile

Ugh. TP7 doesn't support some 8087 instructions.
Reply
#37
is there some metacommands to enable 386+ ints? sumthing like

{+386} at the top of yer proggie.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#38
Quote:is there some metacommands to enable 386+ ints? sumthing like

{+386} at the top of yer proggie.

I don't think so. The support for TP is very poor on the net, but what little I've gleaned from other message boards has indicated that the BASM doesn't support .386 commands. (some of them, anyways)
Reply
#39
I c.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)