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
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 /
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=(
I know what your code does, but what do you want it to do?
sudo rm -rf /
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 =)
Ok, well you just need to use your if condition that you used for going right but change the key and labels. For example
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.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
sudo rm -rf /
.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
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
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 /
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 /
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks