flat assembler
Message board for the users of flat assembler.

Index > DOS > VGA little problem

Author
Thread Post new topic Reply to topic
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 07 Jul 2009, 13:29
Sorry to ask, but this stuff is not working.. why?

Code:
org 0x100

        mov ax, 0xA000
        mov es, ax
        mov ax, 0x0013
        int 0x10

        xor di, di

paint:  call Move
        mov byte [es:di], 0x34
        jmp paint

Move:   and ax, 0x0
        int 0x16
        cmp al, 0x1B
        je exit
        cmp al, 'A'
        je .left
        cmp al, 'W'
        je .up
        cmp al, 'D'
        je .right
        cmp al, 'S'
        je .down
        ret
.left:  dec di
        ret
.up:    sub di, 0x0140
        ret
.right: inc di
        ret
.down:  add di, 0x0140
        ret

exit:   int 0x20     
    
Post 07 Jul 2009, 13:29
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 07 Jul 2009, 15:09
Works to me, i can draw using A,W,D,S.
Don't forget to return back to text mode.

Code:
exit:   
  mov ax, 0x3     ; back to text mode
 int 0x10

        int 0x20
    
Post 07 Jul 2009, 15:09
View user's profile Send private message Visit poster's website Reply with quote
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 07 Jul 2009, 18:42
Does it work for you? wtf

I've tried windows prompt-DOS and DOSbox but it does not work. All it does is to plot a single pixel and nothing more...

Are you using some Virtual Machine? thanks for answer.
Post 07 Jul 2009, 18:42
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 07 Jul 2009, 19:02
No, i'm running Windows XP.
p.s silly to mention, you enabled Caps Lock key?
Post 07 Jul 2009, 19:02
View user's profile Send private message Visit poster's website Reply with quote
eskizo



Joined: 22 Nov 2005
Posts: 59
eskizo 07 Jul 2009, 19:06
thimis: hehehe, thankyou man!
Post 07 Jul 2009, 19:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.