News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A game in graphic mode

Started by amrac, December 28, 2009, 03:50:31 PM

Previous topic - Next topic

dedndave

come to think of it, this code is one byte shorter because there is no segment override   :bg

        mov     quedas,180     ;falls = 180
        push    ax
        push    bx
        push    dx
        push    ds
        xor     ax,ax
        mov     ds,ax
        lds     ax,ds:[46Ch]
        mov     dx,ds
        mov     bx,301
        pop     ds
        div     bx
        mov     coluna,dx
        pop     dx
        pop     bx
        pop     ax

LDS is similar to LES, except it uses the DS register instead of ES

amrac

I've copied you're code and run it and the result is still exactly the same. The ball falls and then jumps to another column. I don't want to be dull  but I think I'm not preserving the registers the right way in another procedure.
I still don't understand that line of code:
lds     ax,ds:[46Ch]

dedndave

put your ASM file into a ZIP file
below the reply window is a link for Additional Options...
click that, and attach the ZIP file
i will look at the entire code and see if i can spot the problem

        lds     ax,ds:[46Ch]

that line of code is the same thing as

        mov     ax,ds:[46Ch]
        mov     ds,ds:[46Eh]

LDS stands for Load DS
LDS AX,[nnnn] loads DS and AX at the same time from the dword addressed by [nnnn]
it could be a label like SomeDwordPointer
LDS AX,SomeDwordPointer
you might see it used with SI
LDS SI,SomeDwordPointer

http://www.arl.wustl.edu/~lockwood/class/cs306/books/artofasm/Chapter_6/CH06-1.html#HEADING1-102

amrac

Hi
Here goes my code.

dedndave

hiya amrac
i am looking at the "pixel" proc
i think there is something wrong with the way the count is kept
let me play with it a little bit....