flat assembler
Message board for the users of flat assembler.
Index
> DOS > How do I Screen delay and Cls Goto page 1, 2 Next |
Author |
|
adroit 05 Mar 2010, 14:08
Can someone show me how to do a screen delay and claer the screen in DOS.
_________________ meshnix |
|||
05 Mar 2010, 14:08 |
|
edfed 05 Mar 2010, 14:18
can you reapeat the question please?
what do you mean by screen delay and claer the screen? |
|||
05 Mar 2010, 14:18 |
|
zhak 05 Mar 2010, 16:36
writing directly to video memory may be the fastest method of clr.
i always use the following: Code: clr: xor di, di mov ax, 0x0720 mov cx, 80*25 @@: mov [gs:di], ax ;gs = 0xb800 (i always use it as video mem base) add di, 2 dec cx jnz short @b ret |
|||
05 Mar 2010, 16:36 |
|
edfed 05 Mar 2010, 16:46
faster in 32 bits:
Code: mov ecx,40*25 mov eax,07200720h @@: mov [gs:ecx*2-2],eax loop @b ret |
|||
05 Mar 2010, 16:46 |
|
MHajduk 05 Mar 2010, 17:54
I wonder if we could do the same this way (code not tested):
Code: push es mov ax, 0720h mov cx, 25*80 xor di, di push gs pop es rep stosw pop es Last edited by MHajduk on 05 Mar 2010, 18:29; edited 1 time in total |
|||
05 Mar 2010, 17:54 |
|
baldr 05 Mar 2010, 18:14
MHajduk,
It works, but why eax/ecx/edi? I'm waiting for SSE version, with snow suppression. ;-) __________ MeshNix, You may use int 10/fn 06 (or fn 07) for compatibility reasons – it should work in any video mode supported by VideoBIOS. |
|||
05 Mar 2010, 18:14 |
|
adroit 05 Mar 2010, 21:09
Yea, something similar
Cthug, the code doesn't work. Oh ok. So how does the label @@ work. I understand the code, but not '@@'. |
|||
05 Mar 2010, 21:09 |
|
edfed 05 Mar 2010, 21:45
read the fasm manual before to ask several questions.
|
|||
05 Mar 2010, 21:45 |
|
zhak 05 Mar 2010, 21:48
it's just unnamed label. jmp @b jumps to the nearest @@ label above and jmp @f jumps to the nearest @@ below the jump instruction. i think those labels are described in fasm tutorial.
|
|||
05 Mar 2010, 21:48 |
|
edfed 05 Mar 2010, 21:56
@b for before
@f for forward |
|||
05 Mar 2010, 21:56 |
|
cthug 05 Mar 2010, 22:34
mm, all kinds of error, that's what you get when at 4am
|
|||
05 Mar 2010, 22:34 |
|
adroit 05 Mar 2010, 22:49
Oh, so they just stand for back and forward to the nearest @@, which I think there can be multiple of @@ labels, right?
Cthug lol |
|||
05 Mar 2010, 22:49 |
|
cthug 05 Mar 2010, 22:50
I fixed it, but try writing directly to video memory, this might not even work on all hardware
Code: org 100h mov ax, 0003h int 10h mov dx, _msg mov ah, 9 int 21h .wait: mov ah, 0Bh int 21h cmp al, 0FFh jne .wait ; exit mov ax, 4C00h int 21h _msg db 'Press Any Key ...', 0Ah, 0Dh, '$' _________________ "There are only two industries that refer to their customers as 'users'." Edward Tufte |
|||
05 Mar 2010, 22:50 |
|
Coddy41 06 Mar 2010, 00:02
whoah... what are this? I noticed you all are using
Code: mov ax, 0x0720 Is this another method of writing to VGA? I always have used 0xB8000 Or is this completely different. _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
06 Mar 2010, 00:02 |
|
baldr 06 Mar 2010, 00:57
Coddy41,
0x0720 is ASCII SPACE with attribute lightgray-on-black. |
|||
06 Mar 2010, 00:57 |
|
adroit 06 Mar 2010, 03:02
how is that possible (well anything is possible but, still...)? Does it block the space in gray?
|
|||
06 Mar 2010, 03:02 |
|
zhak 06 Mar 2010, 09:12
MeshNix wrote: Does it block the space in gray? Didn't get it, but back to the basics... video mode 3 (default, text, 80x25, 16 colors). video memory starts at segment 0xb800. 80*25 = 2000 characters on the screen. each character is displayed by placing WORD at the address that corresponds to its relative position from the beginning of segment because each character in video memory is represented by a character itself (low byte) and color attribute (high byte) so, if you want to put a red '!' on blue background at row 2 column 3, you Code: TXTCOLOR_RED = 0x04 BKGCOLOR_BLUE = 0x10 mov ah, BKGCOLOR_BLUE+TXTCOLOR_RED mov al, '!' mov di, (02*80+03)*2 mov [es:di], ax ;es = 0xb800 puting space character (0x20) clears the screen because it's blank character, you don't see it something like that. maybe guys would provide you with some links on video programming, i don't have any right now |
|||
06 Mar 2010, 09:12 |
|
edfed 06 Mar 2010, 09:20
http://wiki.osdev.org/VGA_Hardware
read it, then, when you have understand the basics of VGA, you will be able to code without asking anything to us, and maybe we will ask to you good luck |
|||
06 Mar 2010, 09:20 |
|
Coddy41 06 Mar 2010, 12:53
baldr wrote: Coddy41, I knew that... That is the last time I come to the fasm board when tired _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
06 Mar 2010, 12:53 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.