Compiling the source of the running boy

Source: Internet
Author: User

; Personal compilation Small website: http://www.x86asm.com

A running boy, after the production of the. exe file just 1K, this program is I in the Big 2 when the study out!

, the program does not use time delay, but cleverly used the loop instruction to make graphics characters constantly covered, you can achieve the effect of running!

If an. exe is executed at a DOS command prompt, my profile will be displayed when I exit!

; The program can be compiled with TASM5.0 and MASM5.0!

, let's try it! Good luck!

. Model Small
;-------------------------------------------------------------------------------
. Data
;
; The boy's running graphic data
; Frame 1 Data
;
Boyd DB 8 dup (0); ASCII 80h (upper left)
DB 8 dup (0); ASCII 81h
DB 0,1,7,31,4 dup (in); ASCII 82h
DB 120,252,244,240,240,240,176,176 ASCII 83h
DB 8 dup (0); ASCII 84h
DB 0,1,3,7,14,14,12,1 ASCII 85h
DB 31,207,231,247,127,126,254,254 ASCII 86h
DB 248,184,200,240,128,0,8,120 ASCII 87h
DB 0,1,3,7,15,14,12,0 ASCII 88h
DB 7,207,207,223,255,255,239,195 ASCII 89h
DB 254,254,255,247,227,128,128,128 ASCII 8ah
DB 120,240,192,128,4 dup (0); ASCII 8BH
DB 8 dup (0); ASCII 8ch
DB 3,3,1,1,4 dup (0); ASCII 8DH
DB 131,135,207,254,252,240,96,0 ASCII 8eh
DB 8 dup (0); ASCII 8fh
;
;
; Frame 2 Data
;
DB 8 dup (0); ASCII 90h
DB 8 dup (0); ASCII 91h
DB 5 dup (0), 3,15,31 ASCII 92h
DB 3 dup (0), 124,2 DUP (254), 252,248; ASCII 93h
DB 8 dup (0); ASCII 94h
DB 3 dup (0), 1,3,7,6,6 ASCII 95h
DB 63,63,31,159,207,231,255,127 ASCII 96h
DB 248,248,216,216,252,220,228,248 ASCII 97h
DB 8 dup (0); ASCII 98h
DB 6,15,63,127,255,255,127,127 ASCII 99h
DB 254,3 DUP (252), 253,223,143,128; ASCII 9ah
DB 0,0,96,224,224,192,128,0 ASCII 9BH
DB 0,1,1,5 dup (0); ASCII 9ch
DB 255,239,207,30,127,255,252,0 ASCII 9DH
DB 192,192,0,0,128,0,0,0 ASCII 9eh
DB 8 dup (0); ASCII 9fh
;
;
; Frame 3 Data
;
DB 8 dup (0); ASCII a0h
DB 8 dup (0); ASCII a1h
DB 0,0,3,7,4 dup; ASCII a2h
DB 0,126,3 DUP (255), 252,236,236; ASCII a3h
DB 8 dup (0); ASCII a4h
DB 7 dup (0), 1; ASCII a5h
DB 15,7,1,1,7,63,255,255 ASCII a6h
DB 254,238,242,252,224,128,0,0 ASCII a7h
DB 7 dup (0), 1; ASCII a8h
DB 1,3,7,15,31,63,255,252 ASCII a9h
DB 255,254,255,255,252,255,255,252 ASCII Aah
DB 0,0,128,128,0,128,0,0 ASCII ABH
DB 3,15,30,30,28,30,30,0 ASCII ach
DB 192,7 dup (0); ASCII adh
DB 62,14,6 dup (0); ASCII Aeh
DB 8 dup (0); ASCII afh
;
;
; Frame 4 Data
;
DB 8 dup (0); ASCII b0h
DB 7 dup (0), ASCII b1h
DB 1,7,4 dup, 7,199; ASCII b2h
DB 254,255,255,253,252,236,236,254 ASCII b3h
DB 5 dup (0), 63,254,254 ASCII b4h
DB 31,30,3 dup (0), 7,31,63; ASCII b5h
DB 227,121,63,63,254,3 dup (255); ASCII b6h
DB 238,242,252,0,3,135,255,252 ASCII b7h
DB 252,63,63,31,4 dup (0); ASCII b8h
DB 4 dup (255), 4 dup (0); ASCII b9h
DB 240,224,192,240,248,63,31,15 ASCII Bah
DB 0,0,96,224,224,192,192,128 ASCII BBH
DB 8 dup (0); ASCII BCH
DB 8 dup (0); ASCII BDH
DB 6,7 dup (0); ASCII Beh
DB 8 dup (0); ASCII BFH
;
;
Out_char db ' author:hsly ', 0dh,0ah
DB ' From:china ', 0dh,0ah
DB ' My website:http://x86asm.yeah.net ', 0dh,0ah
DB ' My e-mail:pliceman_110@163.com ', 0dh,0ah
DB ' time:2002 02-14 ', 0dh,0ah
DB ' Opccupation:student ', 0dh,0ah
DB ' age:22 ', 0dh,0ah
LEN_STR equ $-out_char
ASCII db?
Frame db?
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
. Code
Start:mov Ax, @data
MOV Ds,ax
MOV Es,ax
;
; Set up to use 320x200 color graphic mode first
Main:mov ah,0
MOV al,4
int 10h
;
; Then set the palette color and background color in the 320x200 graphic mode
;
MOV ah,11
MOV bh,1
MOV bl,0
int 10h
;
MOV ah,11
MOV bh,0
MOV bl,1
int 10h
;
; Set the interrupt vector to point to the running boy's graphic data
;
MOV al,1fh
MOV Dx,offset Boyd
MOV ah,25h
int 21h
;
The boy's graphic is running in the upper left corner of the display screen.
Frame1:mov ascii,80h
MOV frame,1
;
Startfr:sub DX,DX
;
Drawchar:mov ah,2; place cursor Position
MOV bh,0
int 10h
; set the boy to yellow and in the blue background, and set the boy's height and width
MOV ah,9
MOV cx,1
MOV bl,03h
MOV al,ascii
int 10h
;
Inc ASCII
Inc DL
CMP dl,3
JNA Drawchar
;
MOV dl,0
Inc DH
CMP dh,3
JNA Drawchar
;
; show the boy's graphic again
;
Call delay; invoke running subroutine
;
Inc frame; Transform Boy display graphics
CMP frame,4
JNA STARTFR
;
; Call Verify keyboard function if you press any key, reset the color mode to 80x25 and return to Dos and display my profile!
MOV AH,0BH
int 21h
CMP AL,0FFH
Jne frame1
XOR DX,DX
XOR BP,BP
MOV ax,03
int 10h
MOV Bp,offset Out_char
MOV cx,len_str
MOV dh,0
MOV dl,33
MOV al,1
MOV Bl,0eh
MOV ah,13h
int 10h
;
MOV ax,4c00h
int 21h
;
;
;
Delay proc
Push CX
MOV cx,10000
Waste:loop Waste
Pop CX
Ret
Delay ENDP
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
. Stack 100h
;-------------------------------------------------------------------------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.