Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Direct acces to video memory in windows

ClebCleb Posts: 23Member
Is there a way to acces videomemory directly in windows?
If not, which is the fastest way to do graphic in windows?

Comments

  • emu8086emu8086 Posts: 125Member
    : Is there a way to acces videomemory directly in windows?
    : If not, which is the fastest way to do graphic in windows?

    - If you want to do fast graphics in Windows, I may recommend DirectX
    library from Microsoft.

    If you want to access video memory on OS level (without any operating
    system), you may want to look at this simple code:

    [code]

    ; This example prints out
    ; "HELLO WORLD!"
    ; by writing directly to
    ; Video Memory.

    ; Compiled on Emu8086

    #make_BIN#

    ; set segment register:
    MOV AX, 0B800h
    MOV DS, AX

    ; print "HELLO" using DS
    ; as segment:

    MOV [52h], 'H'

    MOV [54h], 'E'

    MOV [56h], 'L'

    MOV [58h], 'L'

    MOV [5Ah], 'O'


    ; print "WORD!" using ES
    ; as segment (better since
    ; this way you won't loose
    ; access to variables declared
    ; in code segment).

    ; set segment registers:
    PUSH CS
    POP DS ; DS = CS.
    MOV AX, 0B800h
    MOV ES, AX

    MOV ES:[5Eh], 'W'

    MOV ES:[60h], 'O'

    MOV ES:[62h], 'R'

    MOV ES:[64h], 'L'

    MOV ES:[66h], 'D'

    MOV ES:[68h], '!'

    HLT

    END

    [/code]



  • ClebCleb Posts: 23Member
    : : Is there a way to acces videomemory directly in windows?
    : : If not, which is the fastest way to do graphic in windows?
    :
    : - If you want to do fast graphics in Windows, I may recommend DirectX
    : library from Microsoft.
    :
    : If you want to access video memory on OS level (without any operating
    : system), you may want to look at this simple code:
    :
    : [code]
    :
    : ; This example prints out
    : ; "HELLO WORLD!"
    : ; by writing directly to
    : ; Video Memory.
    :
    : ; Compiled on Emu8086
    :
    : #make_BIN#
    :
    : ; set segment register:
    : MOV AX, 0B800h
    : MOV DS, AX
    :
    : ; print "HELLO" using DS
    : ; as segment:
    :
    : MOV [52h], 'H'
    :
    : MOV [54h], 'E'
    :
    : MOV [56h], 'L'
    :
    : MOV [58h], 'L'
    :
    : MOV [5Ah], 'O'
    :
    :
    : ; print "WORD!" using ES
    : ; as segment (better since
    : ; this way you won't loose
    : ; access to variables declared
    : ; in code segment).
    :
    : ; set segment registers:
    : PUSH CS
    : POP DS ; DS = CS.
    : MOV AX, 0B800h
    : MOV ES, AX
    :
    : MOV ES:[5Eh], 'W'
    :
    : MOV ES:[60h], 'O'
    :
    : MOV ES:[62h], 'R'
    :
    : MOV ES:[64h], 'L'
    :
    : MOV ES:[66h], 'D'
    :
    : MOV ES:[68h], '!'
    :
    : HLT
    :
    : END
    :
    : [/code]
    :
    :
    :
    :

    Thanx for the answer, but isn't directx a bit slow? I ment something like vbe was ind dos or something like that...
    By the way I know how to acces video without os, I've tried to make an os but it was a little boring...

  • emu8086emu8086 Posts: 125Member

    : Thanx for the answer, but isn't directx a bit slow? I ment something
    : like vbe was ind dos or something like that...

    - DirectX is fast enough, since new Graphic Cards have internal
    support for it. All modern games use it.

    : By the way I know how to acces video without os, I've tried to make
    : an os but it was a little boring...

    - You can find a real tiny OS here:
    http://www.emu8086.com/vb/

    (in ASM section)


Sign In or Register to comment.