Palette Col

By admin  

Palette Col
Palette 120 is worth it?

Hello. Do you think this is worth so much money?

I think it looks a great set … if you can allowed to go for it.

Typing Tutor

In this project, which uses graphics, animation and breaks.

For graphics we used the 320Í200 256 color video graphics adapter mode and a medium resolution 320Í200 color graphics adapter. The CGA standard colors used are: white, light blue, yellow. The four color palettes are the background color, cyan, magenta and black. A read and write pixel graphics, functions and 0Ch 0Dh are used, respectively. VGA can generate 64 levels of red, green and blue. The combinations of red, blue, green and produce 64 ^ 3 k as 256 different colors.

Disruptions: the

The interrupts used INT 10h, INT 21h and INT 16h.

INT 10h:

The INT 10h interrupt is used to adjust the screen 320Í200 256 color mode. Color registration is set proportions of red, green and blue. The string is displayed to the interruption.

The character entered by the user prints out interruption INT 10h. To set the position cursor, we 'MoveC "a procedure in which the function 10h of INT 02H interrupt. This feature allows the program to move the cursor in any Instead of the screen. Page does not have to be the one currently displayed.

INT 21h:

Disruption INT 21h are attended by the DOS routines that offer high level of hardware and system resources such as files and directories. that offers many functions make keyboard, video, and file operations. These functions can be classified as a character I / S, file access, memory management, disk access, networks, and miscellaneous. The palette is set to interrupt INT 21h.

INT 16h:

The BIOS interrupt INT 16h provides services keyboard, with INT 10h, a program can request a service, placing the function number in AH before calling INT 16h. we used only the function 00h. This function transfers the first available value key in the keyboard buffer AX. If the buffer empties, the team hopes that the user presses a key. ASCII keys are not echoed of the screen.

CODE:

FIRST FILE ASSEMBLY LANG

STRING_DISPL public
public main_bck

. Small model

draw_row macro x
local l1
, Draw a line in row x column 0 to column 239
mov ah, 0Ch; pixels drawn
mov al, 0111B, white
mov cx, 0, 0 column
mov dx, x, x row
l1:
int 10h
inc cx, the following column
cmp cx, 240; beyond column 239?
jl l1, no, repeat
ENDM

. Data
Monosodium Glutamate "A guardian Typing "DB
msg1 db 'CHASE THE GAME OF THE PHRASE "
PRESS MSG2 DB "A KEY …….'

. Code
proc main_bck
; Initialize DS
MOV AX, @ DATA; segment allocation of the data segment not
MOV DS, AX; mving in the regulation of the segment
MOV ES, AX
LEA BP, MSG
, Sets the display mode
mov ah, 0; setting mode screen
mov al, 13h, 320 * 200 256 colors (mode)
int 10h
The Color recordset
MOV AH, 10H
MOV AL, 10H
MOV BX, 00; color registration
MOV DH, 10; R
MOV CH, 10; G
MOV CL, 90; B
INT 10H
; DRAW LIMITS
DRAW_ROW 30
320 DRAW_ROW
; Select Palette
MOV AH, 0BH
MOV BH, 1
MOV BL, 0
INT 21H
, Select background
MOV BH, 6H
INT 10H
; EDITORIAL
, Display String
MOV AH, 8; Row
MOV DL, 11, col
CALL STRING_DISPL
, The second string SCREEN
LEA BP, MSG1
MOV DH, 10; row
MOV DL, 11, col
CALL STRING_DISPL
, 3rd CHAIN
LEA BP, MSG2
MOV DH, 17; row
MOV DL, 15, col
CALL STRING_DISPL
ret
main_bck endp

PROC STRING_DISPL
MOV AH, 13H
MOV AL, 01H
MOV BH, 00H
MOV BL, 0111B, White
MOV CX, 16
INT 10H
RET
ENDP STRING_DISPL

END

Second File

extrn last_page: close of
public level
main_bck1 public
Public rating
Public bug
MoveC public
. Small model

draw_row macro x
local l1
, Draw a line in the row x column 0 to column 239
mov ah, 0Ch; pixels drawn
mov al, 0111B, white
mov cx, 0, Column 0
mov dx, x, x row
l1:
int 10h
inc cx, the next column
cmp cx, 320; column beyond 239?
jl l1, No, repeat
ENDM

draw_column macro y, z
local l1
And draws a line in the row x between 0 and a column to 239
mov ah, 0Ch; pixels drawn
mov al, 0111B, the white color
mov cx, y; column 0
mov dx, z; Row x
mov bx, 80
add bx, dx
l1:
int 10h
inc dx; the next column
cmp dx, bx, beyond column 239?
jl l1, no, repeat
ENDM

. Data
MSG, DB
db 256 dup arr (?)
score of 0 dB
error of 0 dB
level of 1 dB
. Code
proc main_bck1
; Initialize DS
MOV AX, @ DATA; segment allocation of the data segment not
MOV DS, AX; Moving in the regulation of the segment
MOV ES, AX
, Sets Display Mode
mov ah, 0, set the screen mode
mov al, 13h; 320 * 200 256 colors (mode)
int 10h
The Color Set records
MOV AH, 10H
MOV AL, 10H
MOV BX, 00; color registration
MOV DH, 10; R
MOV CH, 10; G
MOV CL, 90; B
INT 10H
, Draw pictures
DRAW_ROW 10
DRAW_ROW 90
DRAW_ROW 110
190 DRAW_ROW
; Select Palette
MOV AH, 0BH
MOV BH, a
MOV BL, 0
INT 21H
, Select background
MOV BH, 6H
INT 10H
; EDITORIAL
, Display String
CALL STRING_DISPL
CALL USER_STRING
ret
main_bck1 endp

PROC STRING_DISPL
MOV SI, OFFSET MSG
mov dh, 2
mov dl, 1
MoveC call
mov cx, 239
lo:
MOV AH, 0EH
MOV AL, [SI]
MOV BH, 00
mov bl, 5
INT 10H
INC SI
December cx
CMP CX, 0
JG here
RET
ENDP STRING_DISPL

Proc MoveC
mov ah, 02
mov bh, 0
int 10h
ret
MoveC endp

PROC USER_STRING
MOV SI, OFFSET MSG
, Setting the cursor position
MOV DH, 14
MOV DL, 1
MoveC call
mov cx, 239; loop counter
l1:
, Taking user input
mov ah, 0h
int 16h
cmp al, 1Bh
je l4
cmp al, [si]
jne l2
, Print correct letter
MOV AH, 0EH
MOV BH, 00
mov bl, 1111b
INT 10H
add punctuation, 1
jmp L3
l2:
, The letter wrong impression
MOV AH, 0EH
MOV BH, 00
mov bl, 4
INT 10H
add error,
l3:
IF inc
cx December
CMP CX, 0
L1 JG
L4:
last_page call
ret
USER_STRING endp

END

FILE THIRD

extrn STRING_DISPL: about
extrn score: byte
extrn mistake: byte
extrn End2: about
extrn level: byte
public last_page

. Small model

draw_row macro x
local l1
, Draw a line in the row x column 0 to column 239
mov ah, 0Ch; pixels drawn
mov al, 0111B, white
mov cx, 0, Column 0
mov dx, x, x row
l1:
int 10h
inc cx, the next column
cmp cx, 240; beyond column 239?
jl l1, No, repeat

ENDM

. Data
"The last score" MSG1 db
Press MSG3 DB 'any key to continue and ESC to quit'
"No error" MSG2 DB

. Code
proc last_page
; Initialize DS
MOV AX, @ DATA; segment allocation of the data segment not
MOV DS, AX; Mving segment in the regulation of
MOV ES, AX
, Sets the display mode
mov ah, 0, set the screen mode
mov al, 13h; 320 * 200 256 colors (mode)
int 10h
The Color recordset
MOV AH, 10H
MOV AL, 10H
MOV BX, 00; color registration
MOV DH, 10; R
MOV CH, 10; G
MOV CL, 90; B
INT 10H
; DRAW LIMITS
DRAW_ROW 30
320 DRAW_ROW
; Select Palette
MOV AH, 0BH
MOV BH, 1
MOV BL, 0
INT 21H
, Select background
MOV BH, 6H
INT 10H
; EDITORIAL
, Display String
, Show the second string
LEA BP, MSG1
MOV DH, 10; row
MOV DL, 11, col
MOV AH, 13H
MOV AL, 01H
MOV BH, 00H
MOV BL, 0111B, white
MOV CX, 15
INT 10H
, 3rd string
MOV DH, 12; row
MOV DL, 17, col
mov al, score
mov ah, 0
digit call
, 4 th string
LEA BP, MSG2
MOV DH, 14; row
MOV DL, 11, col
MOV AH, 13H
MOV AL, 01H
MOV BH, 00H
MOV BL, 0111B, White
MOV CX, 12
INT 10H
, 5 th string
mov al, error
mov ah, 0
MOV DH, 16; row
MOV DL, 17, col
digit call
, 6th string
LEA BP, MSG3
MOV DH, 18; row
MOV DL, 1, col
MOV AH, 13H
MOV AL, 01H
MOV BH, 00H
MOV BL, 0111B, white
MOV CX, 39
INT 10H
mov ah, a
int 21h
cmp al, 1Bh

year1:
End2 call
ret
last_page endp

proc-digit
mov cl, 100
div cl
Add to 48
mov ch, ah
mov ah, 02
mov bh, 0
int 10h
MOV AH, 0EH
MOV BH, 00
mov bl, 5
INT 10H
mov al, ch
mov ah, 0
mov cl, 10
div cl
Add to 48
mov ch, ah
MOV AH, 0EH
MOV BH, 00
mov bl, 5
INT 10H
mov al, ch
Add to 48
MOV AH, 0EH
MOV BH, 00
mov bl, 5
INT 10H
ret
endp digits
final

Records Room

extrn STRING_DISPL: near
End2 public

. Small model

draw_row macro x
local l1
, Draw a line in row x of the column 0 to column 239
mov ah, 0Ch; pixels drawn
mov al, 0111B, White
mov cx, 0, column 0
mov dx, x; Row x
l1:
int 10h
inc cx, the next column
cmp cx, 240; beyond column 239?
jl l1, no, repeat

ENDM
. Data
'Game over 'msg db
. Code
Proc End2
; Initialize DS
MOV AX, @ DATA segment allocation of the data segment not
MOV DS, AX; mving segment in the regulation of
MOV ES, AX
, Sets the display mode
mov ah, 0; setting mode screen
mov al, 13h, 320 * 200 256 colors (mode)
int 10h
The Color recordset
MOV AH, 10H
MOV AL, 10H
MOV BX, 00; color registration
MOV DH, 10, R
MOV CH, 10; G
MOV CL, 90; B
INT 10H
; DRAW LIMITS
DRAW_ROW 30
320 DRAW_ROW
; Select Palette
MOV AH, 0BH
MOV BH, 1
MOV BL, 0
INT 21H
, Select background
MOV BH, 6H
INT 10H
; EDITORIAL
, Display String
, Show the second string
LEA BP, MSG
MOV DH, 10; row
MOV DL, 15, col
MOV AH, 13H
MOV AL, 01H
MOV BH, 00H
MOV BL, 0111B, White
MOV CX, 9
INT 10H

mov ah, 1h
int 21h
mov ah, 4ch
int 21h
mov ah, 0
int 21h
End2 endp
final

MAIN FILE

extrn main_bck1: about
extrn main_bck: about
. Small model
. Data
. Code
main proc
mov ax, @ data
mov ds, ax
MOV ES, AX
main_bck call
mov ah, 1
int 21h
main_bck1 call
main endp
final

About the Author

i m a student of electrical engineering

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Post a Comment

Your email is never shared. Required fields are marked *

*
*