flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
windwakr 28 Jul 2008, 22:38
simple thing that does what you want:
This makes a '.com' not '.exe' like your code does. com is easier to work with for smaller programs. Code: org 100h ;Make it .com push 0a000h ;Where the screen area is pop es ;^^ mov ax,13h ;Video mode int 10h ;^^ mov cx,64000 ;screen has 64,000 pixels a_loop: inc byte [es:di] ;YOU HAVE TO USE [es:di], NOT [di] inc di ;Next pixel loop a_loop ;Loop 64k times key: ;Simple checking for escape in al,60h ;Don't use for anything you'll actually release.. dec al ;People will complain... jnz key ; ret ; |
|||
![]() |
|
BastetFurry 28 Jul 2008, 23:00
First, thanks
![]() Some question about your code, i dont see you decrementing register cx, does loop do that for you? |
|||
![]() |
|
windwakr 28 Jul 2008, 23:03
loop basically does two things in one. It decrements cx and does jnz
BTW: Your code has a few flaws. It never stops looping because at loopend you have it jump back to the first loop. The next dec di would make di FFFF and cause the whole thing to start back up. Also, you zero out ax but don't actually use it. |
|||
![]() |
|
BastetFurry 28 Jul 2008, 23:17
Um, i wanted it to go trough all colors, i assume that when some memory location contains $ff and i "inc" that, that it turns to $00.
|
|||
![]() |
|
windwakr 28 Jul 2008, 23:18
Ohhhh, I thought you wanted it to go through once, sorry.
Edit: Is this like what you wanted? Code: org 100h ;Make it .com push 0a000h ;Where the screen area is pop es ;^^ mov ax,13h ;Video mode int 10h ;^^ start: mov cx,64000 ;screen has 64,000 pixels a_loop: inc byte [es:di] ;YOU HAVE TO USE [es:di], NOT [di] inc di ;Next pixel loop a_loop ;Loop 64k times key: ;Simple checking for escape in al,60h ;Don't use for anything you'll actually release.. dec al ;People will complain... jnz start ; ret It doesn't look all that great because it doesn't wait for vertical retrace. BastetFurry wrote:
Ya, it would go to 0 Take a look at This Thread for some good links on DOS coding. Especially check out Ralph Browns Interrupt list. |
|||
![]() |
|
BastetFurry 28 Jul 2008, 23:40
windwakr wrote:
Trying to get that done ATM ![]() I know that under QB45 its: WAIT &h3da,8 So i have this, but he never leaves the loop. Code: mov dx,0x03da vblankloop: in ax,dx cmp ax,8 jne vblankloop windwakr wrote:
Thanks ![]() EDIT: Exchanged cmp with test and now it works. ![]() |
|||
![]() |
|
edfed 29 Jul 2008, 00:20
try this
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.