Movements in Assembly Language

liunx

Guest
I am try to put movements to a box i created using Assembly Language. Can someone give me a little help please. Just a starter with one of the cursor keys please. I need to use the up,down,left and right arrow keys. Thanks. The codes can be located below.<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->TITLE   TEST OF INCLUDE - drawing a box using values<br /><br />    .MODEL SMALL<br />    .STACK 64<br /><br />INCLUDE MYMAC.LIB<br /><br />.DATA<br />  VAR   DB ?<br />  VAR2  DB ?<br />.CODE<br />BEGIN PROC NEAR<br />    MOV AX,@DATA<br />    MOV DS,AX<br />    MOV ES,AX<br /><br />  CLRSCR<br />  <br />  CUAD 12,30,14,35,7<br /><br />  DELAY<br /><br />BEGIN ENDP<br />    END BEGIN<br /><!--c2--></div><!--ec2--><br /><br />*********and this is the library file i am using **********<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->DELAY MACRO<br />   MOV AH,07H<br />   INT 21H<br /> ENDM<br /> <br /> CLRSCR MACRO<br />    MOV AH,00H<br />    MOV AL,03H<br />    INT 10H<br /> ENDM<br /><br />GOTOXY MACRO X,Y<br />   MOV AH,02H<br />   MOV BH,0H<br />   MOV DH,X<br />   MOV DL,Y<br />   INT 10H<br /> ENDM<br /> <br /> PUTCAR MACRO CAR<br />   MOV AH,02H<br />   MOV DL,CAR<br />   INT 21H   <br /> ENDM<br /> <br /> PUTCHAR MACRO CHAR,HOWM<br />   MOV AH,0AH<br />   MOV AL,CHAR<br />   MOV BH,0H<br />   MOV BL,07H<br />   MOV CX,HOWM<br />   INT 10H   <br /> ENDM<br /> <br /> COLOR MACRO BCKGRND,LINES,FFI,CCI,FFF,CCF       <br />       MOV AH,06H<br />       MOV AL,LINES<br />       MOV BH,BCKGRND<br />       MOV CH,FFI<br />       MOV CL,CCI<br />       MOV DH,FFF<br />       MOV DL,CCF<br />       INT 10H<br /> ENDM<br /> <br /> CUAD MACRO FI,CI,FF,CF,COLORES<br />       LOCAL VERTICAL       <br />       MOV CL,FF<br />       SUB CL,FI<br />       COLOR COLORES,CL,FI,CI,FF,CF       <br />      ; PONE LAS LINEAS HORIZONTALES       <br />       MOV DL,CF<br />       SUB DL,CI<br />       PUSH DX<br />       GOTOXY FI,CI<br />       POP DX<br />       MOV DH,0<br />       PUTCHAR 205,DX<br />       MOV DL,CF<br />       SUB DL,CI<br />       PUSH DX<br />       GOTOXY FF,CI<br />       POP DX<br />       MOV DH,0H<br />       PUTCHAR 205,DX<br />         <br />      ; PONE LAS LINEAS VERTICALES<br />       MOV CL,FF<br />       SUB CL,FI<br />       MOV CH,0<br />       MOV AH,FI<br />       MOV VAR2,AH<br />  VERTICAL:<br />          GOTOXY VAR2,CI<br />          PUTCAR 186<br />          GOTOXY VAR2,CF<br />          PUTCAR 186<br />          INC VAR2<br />       LOOP VERTICAL<br />       <br />       GOTOXY FI,CI<br />       PUTCAR 201<br />       GOTOXY FI,CF<br />       PUTCAR 187<br />       GOTOXY FF,CI<br />       PUTCAR 200<br />       GOTOXY FF,CF<br />       PUTCAR 188<br />             <br /> ENDM<br /><!--c2--></div><!--ec2-->
</div>
 
Back
Top