Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: help on TASM video buffer pls

  1. #1
    helpmepls is offline Newbie
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    help on TASM video buffer pls

    it is currently moving to the right. can someone teach me how to move the whole screen to the top?i really need help


    .MODEL SMALL
    .STACK 64
    .DATA
    ;DATA FILE ARE LOCATED HERE

    .CODE
    MAIN PROC FAR
    MOV AX,0B800h
    MOV DS,AX
    ;CODE FILES ARE LOCATED HERE
    MOV AL,03
    INT 10H


    HULAT:
    MOV AH,00
    INT 16H

    CMP AL,'D'
    JNZ HULAT
    JMP RIGHT





    RIGHT:
    MOV BX,01DEH
    MOV SI,01DCH

    MOV AX,0000H
    MOV AL,[BX]

    PUSH AX

    MOV CX,79

    AGAIN:
    MOV AL,[SI]
    MOV BYTE PTR[BX],AL
    SUB BX,2
    SUB SI,2
    LOOP AGAIN

    POP AX
    MOV [BX],AL

    JMP HULAT


    MOV AH,4CH
    INT 21H
    MAIN ENDP
    END MAIN

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: help on TASM video buffer pls

    Do you want to scroll the screen upwards when the user presses a certain key? Here's how to scroll the screen up by one line.

    Code:
    mov     ax, 0601h   ; AH=06h, AL is # of lines to shift up
    ;if you want to clear the whole screen put AL=0
    
    mov     bh, 07h     ; screen attr to fill blank lines @ bottom
    xor     cx, cx      ; CH=upper left row, CL=upper left column (0,0)
    mov     dx, 184fh   ; DL=lower right row, CL=lower right column
    
    ; 184fh corresponds to row 24, column 79. NOTE: I'm assuming you're
    ; using video mode 3 like you have at the beginning of your code. If you
    ; use a different video mode you're going to have to change the coordi-
    ; nates.
    
    int     10h
    Last edited by dargueta; 03-09-2010 at 08:03 PM. Reason: Edited formatting
    sudo rm -rf /

  4. #3
    helpmepls is offline Newbie
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Re: help on TASM video buffer pls

    thank u very much 4 the help bro. can u pls teach me what part of the program should i put or replace your codes? im still a bit new and cant seem to make the program to work=(

  5. #4
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: help on TASM video buffer pls

    I know what your code does, but what do you want it to do?
    sudo rm -rf /

  6. #5
    helpmepls is offline Newbie
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Re: help on TASM video buffer pls

    i have to make the screen go left,right top,down using wasd, i already got it to move to the left and right. but i have no idea how to make it go to the top and bottom. i was hoping to learn how to make it go up and down =)

  7. #6
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: help on TASM video buffer pls

    Ok, well you just need to use your if condition that you used for going right but change the key and labels. For example
    Code:
    mov    ah, 00h
    int    16h
    
    cmp    al, 'D'
    je    do_right
    cmp    al, 'S'
    je    do_down
    cmp    al, 'A'
    je    do_left
    cmp    al, 'W'
    je    do_right
    You would put my code in the do_down part, and the code for scrolling up is identical except you put 07h into AH instead of 06h.
    sudo rm -rf /

  8. #7
    helpmepls is offline Newbie
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Re: help on TASM video buffer pls

    .MODEL SMALL
    .STACK 64
    .DATA
    ;DATA FILE ARE LOCATED HERE

    .CODE
    MAIN PROC FAR
    MOV AX,0B800h
    MOV DS,AX
    ;CODE FILES ARE LOCATED HERE
    MOV AL,03
    INT 10H


    HULAT:
    MOV AH,00
    INT 16H

    CMP AL,'D'
    JNZ HULAT
    JMP RIGHT




    RIGHT: MOV AX,0601H
    MOV BH,07H

    XOR CX,CX
    MOV DX,0184FH






    AGAIN:
    MOV AL,[SI]
    MOV BYTE PTR[BX],AL
    SUB BX,2
    SUB SI,2
    LOOP AGAIN

    POP AX
    MOV [BX],AL

    JMP HULAT


    MOV AH,4CH
    INT 21H
    MAIN ENDP
    END MAIN

  9. #8
    helpmepls is offline Newbie
    Join Date
    Mar 2010
    Posts
    9
    Rep Power
    0

    Re: help on TASM video buffer pls

    sorry buy i still cant get it to work. even just going up. where do u mean should i put your code? i tried replacing right w/ ur code but i cant get it to work

    .MODEL SMALL
    .STACK 64
    .DATA
    ;DATA FILE ARE LOCATED HERE

    .CODE
    MAIN PROC FAR
    MOV AX,0B800h
    MOV DS,AX
    ;CODE FILES ARE LOCATED HERE
    MOV AL,03
    INT 10H


    HULAT:
    MOV AH,00
    INT 16H

    CMP AL,'D'
    JNZ HULAT
    JMP RIGHT




    RIGHT: MOV AX,0601H
    MOV BH,07H

    XOR CX,CX
    MOV DX,0184FH






    AGAIN:
    MOV AL,[SI]
    MOV BYTE PTR[BX],AL
    SUB BX,2
    SUB SI,2
    LOOP AGAIN

    POP AX
    MOV [BX],AL

    JMP HULAT


    MOV AH,4CH
    INT 21H
    MAIN ENDP
    END MAIN

  10. #9
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: help on TASM video buffer pls

    No, that's not what I meant. First you need to test for w and s, and use my code for those, not the up/down.
    Code:
    .MODEL SMALL
    .STACK 64
    .DATA
    ;DATA FILE ARE LOCATED HERE
    
    ;CODE FILES ARE LOCATED HERE
    .CODE
    MAIN PROC FAR
        MOV AX,0B800h
        MOV DS,AX        
        MOV AL,03
        INT 10H
    
        HULAT:
            MOV AH,00
            INT 16H
    
            CMP AL,'D'
            JZ  RIGHT
            
            CMP AL, 'A'
            JZ  LEFT
            
            CMP AL, 'W'
            JZ  UP
            
            CMP AL, 'S'
            JZ  DOWN
    
            JMP HULAT
            
        DOWN:
            ; MY CODE FOR GOING DOWN HERE
            
        UP:
            ; MY CODE FOR GOING UP HERE
            
        LEFT:
            ; YOUR CODE FOR GOING LEFT HERE
            
        RIGHT:
            MOV BX,01DEH
            MOV SI,01DCH
            MOV AX,0000H
            MOV AL,[BX]
            PUSH AX
            MOV CX,79
    
            AGAIN:
                MOV AL,[SI]
                MOV BYTE PTR[BX],AL
                SUB BX,2
                SUB SI,2
                LOOP AGAIN
    
            POP AX
            MOV [BX],AL
            JMP HULAT
    
        MOV AH,4CH
        INT 21H
    MAIN ENDP
    END MAIN
    Last edited by dargueta; 03-11-2010 at 01:23 PM. Reason: Added code
    sudo rm -rf /

  11. #10
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: help on TASM video buffer pls

    Cheap shot, using your sig to post links...

    EDIT: This no longer makes any sense because the spam post before me was removed.
    Last edited by dargueta; 03-14-2010 at 02:08 PM.
    sudo rm -rf /

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. TASM TASM program help : Sorting
    By Nagasaki in forum Assembly
    Replies: 1
    Last Post: 10-12-2011, 03:49 PM
  2. TASM Recursion in TASM
    By assembler_wanna_be in forum Assembly
    Replies: 1
    Last Post: 01-11-2011, 11:29 PM
  3. TASM tasm symbol painting
    By core_st in forum Assembly
    Replies: 4
    Last Post: 12-03-2010, 02:31 PM
  4. TASM I need HELP with TASM and TLINK PLEASE.....
    By jai_ho in forum Assembly
    Replies: 3
    Last Post: 11-26-2010, 03:00 AM
  5. TASM how to put pixel in TASM VESA 32-bit?
    By D@rkD@iver in forum Assembly
    Replies: 1
    Last Post: 06-08-2010, 03:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts