News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

scrolling text?

Started by HATEM, July 04, 2007, 09:28:33 PM

Previous topic - Next topic

HATEM

hello
how can i appear a scrolling text  on the screen :( i want a simple program please

Tedd

Part 1: draw text on screen.
Part 2: Draw text on screen at previous offset - 1
Part 3: loop at part 2
No snowflake in an avalanche feels responsible.

MichaelW

Or use Interrupt 10h functions 6 or 7 to scroll the text, and then update the top or bottom line.

http://www.ctyme.com/intr/rb-0096.htm

http://www.ctyme.com/intr/rb-0097.htm
eschew obfuscation

HATEM

thank you for your help bat i'm a newbie in ASM  :red please explain to me step by step

eek


HATEM

Quote from: eek on July 06, 2007, 02:08:49 AM
...homework
:lol
it's not a home work eek i'm just want learning to programming game and if you have a good site where can i find games in assembly 16 bit give it to me
don't forget my first question thank you  :wink

Tedd

1. Learn how to display text on the screen
2. Learn how to place text at any position on the screen
3. Put the two together :wink
No snowflake in an avalanche feels responsible.

HATEM

hello tedd i do my homework  :bg
i did what do you want me to do  :wink
and now how can i scroll it  :toothy

declaration       segment
assume       cs:declaration
CALL  start

start         proc         
        mov        ah,06h         
        mov        al,00h
   mov        bh,07h   
   mov        ch,00h     
   mov        cl,00h       
   mov        dh,24       
   mov        dl,79       
   int        10h
   mov        bh,0         
   mov        dh,12       
   mov        dl,35       
   mov        ah,02h
   int        10h
   mov        dl,'A'
        mov        ah,02h
   int        21h
   mov        ah,4ch
   int        21h
start       endp
   declaration       ends
           end             start

MichaelW

#8
If by scrolling you mean that the screen should simply scroll up after the CRLF on the last line, any BIOS function that updates the cursor position and processes CR (character code 13) and LF (character code 10), or any DOS function that calls one of these BIOS functions, will do this.

.model small
.stack
.data
    string db "xxx",13,10,"$"
.code
.startup
 
    ; Loop through 40 lines.
    mov cx, 40
  @@:
    ; Display the string. The terminating CRLF will cause
    ; the function to move the cursor to the start of the
    ; next line, and when the cursor reaches the bottom
    ; of the screen, scroll the screen up by one line.
    mov dx, OFFSET string
    mov ah, 9
    int 21h
   
    ; Wait for a key press before continuing.
    xor ah, ah
    int 16h
   
    dec cx
    jnz @B
.exit
end

eschew obfuscation

HATEM

thank you for your help
i think there are some mistakes in your code it doesn't work  :(

MichaelW

The code assembles, links, and runs correctly on my system. I have now added some comments that explain what the code is doing. What problem are you having?
eschew obfuscation

HATEM

hello MichaelW
look there are two fault in line 6'.startup'
and in line 25 '.exit'

[attachment deleted by admin]

MichaelW

I had no idea you were using MASM 5.1. Here is a version that should work with 5.1:

.model small
.stack
.data
    string db "xxx",13,10,"$"
.code

  start:

    ; Set DS to our data segment.
    ;
    mov ax, @data
    mov ds, ax

    ; Loop through 40 lines.
    ;
    mov cx, 40

  @@:
    ; Display the string. The terminating CRLF will cause
    ; the function to move the cursor to the start of the
    ; next line, and when the cursor reaches the bottom
    ; of the screen, scroll the screen up by one line.
    ;
    mov dx, OFFSET string
    mov ah, 9
    int 21h

    ; Wait for key press before continuing.
    ;
    xor ah, ah
    int 16h

    dec cx
    jnz @B

    mov ah,4ch
    int 21h

end start

eschew obfuscation

HATEM

thank you MichaelW
sorry you worked hard with me I think that you don't understand what i want to do
look i want to do like this
hello