flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
adroit
Can someone show me how to do a screen delay and claer the screen in DOS.
_________________ meshnix |
|||
![]() |
|
edfed
can you reapeat the question please?
what do you mean by screen delay and claer the screen? |
|||
![]() |
|
zhak
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 |
|||
![]() |
|
edfed
faster in 32 bits:
Code: mov ecx,40*25 mov eax,07200720h @@: mov [gs:ecx*2-2],eax loop @b ret |
|||
![]() |
|
MHajduk
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 |
|||
![]() |
|
baldr
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. |
|||
![]() |
|
adroit
Yea, something similar
Cthug, the code doesn't work. Oh ok. So how does the label @@ work. I understand the code, but not '@@'. |
|||
![]() |
|
edfed
read the fasm manual before to ask several questions.
|
|||
![]() |
|
zhak
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.
|
|||
![]() |
|
edfed
@b for before
@f for forward |
|||
![]() |
|
cthug
mm, all kinds of error, that's what you get when at 4am
![]() |
|||
![]() |
|
adroit
Oh, so they just stand for back and forward to the nearest @@, which I think there can be multiple of @@ labels, right?
Cthug lol |
|||
![]() |
|
cthug
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 |
|||
![]() |
|
Coddy41
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) |
|||
![]() |
|
baldr
Coddy41,
0x0720 is ASCII SPACE with attribute lightgray-on-black. ![]() |
|||
![]() |
|
adroit
how is that possible (well anything is possible but, still...)? Does it block the space in gray?
|
|||
![]() |
|
zhak
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 |
|||
![]() |
|
edfed
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 |
|||
![]() |
|
Coddy41
baldr wrote: Coddy41, ![]() ![]() _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.