Macro Adapter

Typing Tutor
In this project, I used graphics, animations and interrupts.
For graphics we used the 320Í200 256 color video adapter graphics display mode and medium resolution of 320Í200 for color graphics adapter. The standard CGA colors we used are: white, light blue, yellow. The four colors of the palettes are the background color, cyan, magenta and white. To read and write graphics pixels, the functions 0Dh and 0Ch are used, respectively. VGA can generate 64 levels of red, green, and blue. The combinations of the red, blue, and green colors produce 64^3 equal 256 k different colors.
Interrupts Used:
The interrupts we used are INT 10h, INT 21h, and INT 16h.
INT 10h:
The interrupt INT 10h is used to set the display mode of 320Í200 256 color. The color register is set in proportions of Red, Green, and Blue. The string is displayed using this interrupt.
The character entered by the user is printed on the screen by interrupt INT 10h. To set the cursor position, we made a procedure ‘movec’ in which the function 02h of the interrupt INT 10h. This function lets the program move the cursor anywhere on the screen. The page doesn’t have to be the one currently being displayed.
INT 21h:
The interrupt INT 21h are serviced by DOS routines that provide high level service to hardware as well as system resources such as files and directories. it provides many functions for doing keyboard, video, and file operations. These functions may be classified as character I/O, file access, memory management, disk access, networking, and miscellaneous. The palette is set by interrupt INT 21h.
INT 16h:
The interrupt BIOS INT 16h provides keyboard services, as with INT 10h, a program can request a service by placing the function number in AH before calling INT 16h. we used only its function 00h. This function transfers the first available key value in the keyboard buffer into AX. If the buffer is empty, the computer waits for the user to press a key. ASCII keys are not echoed to the screen.
CODE:
FIRST FILE OF ASSEMBLY LANG
public STRING_DISPL
public main_bck
.model small
draw_row macro x
local l1
;draws a line in row x from column 0 to column 239
mov ah,0ch ;draw pixel
mov al,0111B ;white color
mov cx,0 ;column 0
mov dx,x ;row x
l1:
int 10h
inc cx ;next column
cmp cx,240 ;beyond column 239?
jl l1 ;no, repeat
endm
.data
MSG DB ‘A TYPING TUTOR’
msg1 db ‘CHASE THE PHRASE GAME’
mSG2 DB ‘PRESS ANY KEY…….’
.code
main_bck proc
;initialize DS
MOV AX,@DATA ;assigning segment no of the data segment
MOV DS,AX ;mving in segment reg
MOV ES,AX
LEA BP,MSG
;sets display mode
mov ah,0 ;set screen mode
mov al,13h ;320*200 256 color(mode)
int 10h
;set color register
MOV AH,10H
MOV AL,10H
MOV BX,00 ; Color Register
MOV DH,10 ; R
MOV CH,10 ; G
MOV CL,90 ; B
INT 10H
;DRAW BOUNDARY
DRAW_ROW 30
DRAW_ROW 320
;SELECT PALETTE
MOV AH,0BH
MOV BH,1
MOV BL,0
INT 21H
;SELECT BACKGROUND
MOV BH,6H
INT 10H
;WRITE TEXT
;STRING DISPLAY
MOV DH ,8 ;row
MOV DL,11 ;col
CALL STRING_DISPL
;SECOND STRING DISPLAY
LEA BP,MSG1
MOV DH ,10 ;row
MOV DL,11 ;col
CALL STRING_DISPL
;3RD STRING
LEA BP,MSG2
MOV DH ,17 ;row
MOV DL,15 ;col
CALL STRING_DISPL
ret
main_bck endp
STRING_DISPL PROC
MOV AH ,13H
MOV AL ,01H
MOV BH ,00H
MOV BL ,0111B ;white color
MOV CX ,16
INT 10H
RET
STRING_DISPL ENDP
END
SECOND FILE
extrn last_page:near
public level
public main_bck1
public score
public error
public movec
.model small
draw_row macro x
local l1
;draws a line in row x from column 0 to column 239
mov ah,0ch ;draw pixel
mov al,0111B ;white color
mov cx,0 ;column 0
mov dx,x ;row x
l1:
int 10h
inc cx ;next column
cmp cx,320 ;beyond column 239?
jl l1 ;no, repeat
endm
draw_column macro y,z
local l1
;draws a line in row x from column 0 to column 239
mov ah,0ch ;draw pixel
mov al,0111B ;white color
mov cx,y ;column 0
mov dx,z ;row x
mov bx,80
add bx,dx
l1:
int 10h
inc dx ;next column
cmp dx,bx ;beyond column 239?
jl l1 ;no, repeat
endm
.data
MSG DB ‘adsfasdsfasfdsfsddasfdsfsdfsafdffsdfsfdsasfdsasfdfsfdsdfddsfasdadfdadfjadfksdfkdfkfajdsakldfdsfafdf;fkfadsf;lkdsjf;dkjflkdf;akhdjlkfdslf;ak;ajfldkaldkjf;ldkjf;ajf;ldhj;ldkfj;lf;adsjfkkdkdjfasjfdldajkdljf;lfjld;kf;;ldadfdkjf;ldsakdlsjf;adldkjf’
arr db 256 dup(?)
score db 0
error db 0
level db 1
.code
main_bck1 proc
;initialize DS
MOV AX,@DATA ;assigning segment no of the data segment
MOV DS,AX ;moving in segment reg
MOV ES,AX
;sets display mode
mov ah,0 ;set screen mode
mov al,13h ;320*200 256 color(mode)
int 10h
;set color register
MOV AH,10H
MOV AL,10H
MOV BX,00 ; Color Register
MOV DH,10 ; R
MOV CH,10 ; G
MOV CL,90 ; B
INT 10H
;DRAW SQUARE
DRAW_ROW 10
DRAW_ROW 90
DRAW_ROW 110
DRAW_ROW 190
;SELECT PALETTE
MOV AH,0BH
MOV BH,1
MOV BL,0
INT 21H
;SELECT BACKGROUND
MOV BH,6H
INT 10H
;WRITE TEXT
;STRING DISPLAY
CALL STRING_DISPL
CALL USER_STRING
ret
main_bck1 endp
STRING_DISPL PROC
MOV SI , OFFSET MSG
mov dh,2
mov dl,1
call movec
mov cx,239
lo:
MOV AH ,0EH
MOV AL ,[SI]
MOV BH,00
mov bl,5
INT 10H
INC SI
DEC cx
CMP cx,0
JG lo
RET
STRING_DISPL ENDP
movec proc
mov ah,02
mov bh,0
int 10h
ret
movec endp
USER_STRING PROC
MOV SI,OFFSET MSG
;setting cursor position
MOV dh,14
MOV dl,1
call movec
mov cx,239 ;loop counter
l1:
;taking input from user
mov ah,0h
int 16h
cmp al,1bh
je l4
cmp al,[si]
jne l2
;printing correct letter
MOV AH,0EH
MOV BH,00
mov bl,1111b
INT 10H
add score,1
jmp l3
l2:
;printing wrong letter
MOV AH ,0EH
MOV BH,00
mov bl,4
INT 10H
add error,1
l3:
inc SI
dec cx
CMP cx,0
JG l1
l4:
call last_page
ret
USER_STRING endp
END
THIRD FILE
extrn STRING_DISPL:near
extrn score:byte
extrn error:byte
extrn end2:near
extrn level:byte
public last_page
.model small
draw_row macro x
local l1
;draws a line in row x from column 0 to column 239
mov ah,0ch ;draw pixel
mov al,0111B ;white color
mov cx,0 ;column 0
mov dx,x ;row x
l1:
int 10h
inc cx ;next column
cmp cx,240 ;beyond column 239?
jl l1 ;no, repeat
endm
.data
MSG1 db ‘your last score’
MSG3 DB ‘Press any key to continue & esc to exit’
MSG2 DB ‘no of errors’
.code
last_page proc
;initialize DS
MOV AX,@DATA ;assigning segment no of the data segment
MOV DS,AX ;mving in segment reg
MOV ES,AX
;sets display mode
mov ah,0 ;set screen mode
mov al,13h ;320*200 256 color(mode)
int 10h
;set color register
MOV AH,10H
MOV AL,10H
MOV BX,00 ; Color Register
MOV DH,10 ; R
MOV CH,10 ; G
MOV CL,90 ; B
INT 10H
;DRAW BOUNDARY
DRAW_ROW 30
DRAW_ROW 320
;SELECT PALETTE
MOV AH,0BH
MOV BH,1
MOV BL,0
INT 21H
;SELECT BACKGROUND
MOV BH,6H
INT 10H
;WRITE TEXT
;STRING DISPLAY
;SECOND STRING DISPLAY
LEA BP,MSG1
MOV DH ,10 ;row
MOV DL,11 ;col
MOV AH ,13H
MOV AL ,01H
MOV BH ,00H
MOV BL ,0111B ;white color
MOV CX ,15
INT 10H
;3RD STRING
MOV DH ,12 ;row
MOV DL,17 ;col
mov al,score
mov ah,0
call digit
;4th 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 color
MOV CX ,12
INT 10H
;5th STRING
mov al,error
mov ah,0
MOV DH ,16 ;row
MOV DL,17 ;col
call digit
;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 color
MOV CX ,39
INT 10H
mov ah,1
int 21h
cmp al,1bh
end1:
call end2
ret
last_page endp
digit proc
mov cl,100
div cl
add al, 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 al, 48
mov ch, ah
MOV AH ,0EH
MOV BH,00
mov bl,5
INT 10H
mov al, ch
add al, 48
MOV AH ,0EH
MOV BH,00
mov bl,5
INT 10H
ret
digit endp
end
FORTH FILE
extrn STRING_DISPL:near
public end2
.model small
draw_row macro x
local l1
;draws a line in row x from column 0 to column 239
mov ah,0ch ;draw pixel
mov al,0111B ;white color
mov cx,0 ;column 0
mov dx,x ;row x
l1:
int 10h
inc cx ;next column
cmp cx,240 ;beyond column 239?
jl l1 ;no, repeat
endm
.data
MSG db ‘Game over’
.code
end2 proc
;initialize DS
MOV AX,@DATA ;assigning segment no of the data segment
MOV DS,AX ;mving in segment reg
MOV ES,AX
;sets display mode
mov ah,0 ;set screen mode
mov al,13h ;320*200 256 color(mode)
int 10h
;set color register
MOV AH,10H
MOV AL,10H
MOV BX,00 ; Color Register
MOV DH,10 ; R
MOV CH,10 ; G
MOV CL,90 ; B
INT 10H
;DRAW BOUNDARY
DRAW_ROW 30
DRAW_ROW 320
;SELECT PALETTE
MOV AH,0BH
MOV BH,1
MOV BL,0
INT 21H
;SELECT BACKGROUND
MOV BH,6H
INT 10H
;WRITE TEXT
;STRING DISPLAY
;SECOND STRING DISPLAY
LEA BP,MSG
MOV DH ,10 ;row
MOV DL,15 ;col
MOV AH ,13H
MOV AL ,01H
MOV BH ,00H
MOV BL ,0111B ;white color
MOV CX ,9
INT 10H
mov ah,1h
int 21h
mov ah,4ch
int 21h
mov ah,0
int 21h
end2 endp
end
MAIN FILE
extrn main_bck1:near
extrn main_bck:near
.model small
.data
.code
main proc
mov ax,@data
mov ds,ax
MOV ES,AX
call main_bck
mov ah,1
int 21h
call main_bck1
main endp
end
About the Author
i m a student of electrical engineering
|
|
52mm Macro Reverse Adapter Ring for Nikon AF Mount Camera DSLR Digital SLR 52mm $3.59 |
|
|
52mm Macro Reverse Adapter Ring for Nikon AF Mount D700 D3000 D3100 D5100 18-55 $3.59 |
|
|
Macro 77mm Reverse Mount Adapter Ring for Nikon Lens $7.90 |
|
|
Macro 77mm Reverse Mount Adapter Ring 4 Canon EOS Lens $7.90 |
|
|
Macro 72mm Reverse Mount Adapter Ring 4 Canon EOS Lens $7.90 |
|
|
Macro 67mm Reverse Mount Adapter Ring for Nikon Lens $6.90 |
|
|
Macro 67mm Reverse Mount Adapter Ring 4 Canon EOS Lens $6.90 |
|
|
Macro 62mm Reverse Mount Adapter Ring for Nikon Lens $6.90 |
|
|
Macro 62mm Reverse Mount Adapter Ring 4 Canon EOS Lens $6.90 |
|
|
Macro 58mm Reverse Mount Adapter Ring for Nikon Lens $5.90 |
|
|
Macro 58mm Reverse Mount Adapter Ring 4 Sony/Minolta AF $5.90 |
|
|
Macro 58mm Reverse Mount Adapter Ring 4 Pentax PK Lens $5.90 |
|
|
Macro 55mm Reverse Mount Adapter Ring for Nikon Lens $5.90 |
|
|
Macro 55mm Reverse Mount Adapter Ring 4 Sony/Minolta AF $5.90 |
|
|
Macro 55mm Reverse Mount Adapter Ring 4 Pentax PK Lens $5.90 |
|
|
Macro 55mm Reverse Mount Adapter Ring 4 Canon EOS Lens $5.90 |
|
|
Macro 52mm Reverse Mount Adapter Ring for Nikon Lens $5.90 |
|
|
Macro 52mm Reverse Mount Adapter Ring 4 Sony/Minolta AF $5.90 |
|
|
Macro 52mm Reverse Mount Adapter Ring 4 Pentax PK Lens $5.90 |
|
|
Macro 52mm Reverse Mount Adapter Ring 4 Canon EOS Lens $5.90 |
|
|
Macro 52mm Reverse Mount Adapter Ring for Nikon Lens $7.90 |
|
|
new Prost 52 mm 52mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H267 $2.82 |
|
|
new Prost 55 mm 55mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H268 $2.82 |
|
|
new Prost 58 mm 58mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H269 $2.82 |
|
|
new Prost 62 mm 62mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H270 $3.99 |
|
|
new Prost 67 mm 67mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H271 $4.15 |
|
|
new Prost 72 mm 72mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H272 $4.55 |
|
|
new Prost 77 mm 77mm Macro Reverse Adapter Ring for Olympus DSLR E520 E510 H273 $4.75 |
|
|
52mm Macro Reverse Adapter Ring Sony E NEX NEX-3 NEX-5 $17.09 |
|
|
58mm Macro Reverse Adapter Ring Sony E NEX NEX-3 NEX-5 $12.53 |
|
|
T2 T Mount Lens to Sony Minolta AF Body Mount Macro Focusing metal Adapter Black $14.99 |
|
|
2nd Generation Macro AF Confirm MD MC Lens to Canon EOS EF Mount Adapter $22.90 |
|
|
new Prost 52 mm 52mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H259 $2.82 |
|
|
new Prost 58 mm 58mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H261 $2.82 |
|
|
new Prost 62 mm 62mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H262 $4.12 |
|
|
new Prost 67 mm 67mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H263 $4.25 |
|
|
new Prost 72 mm 72mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H264 $4.45 |
|
|
new Prost 77 mm 77mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR H265 $4.65 |
|
|
Prost 55 mm 55mm Macro Reverse Adapter Ring for Pentax K/PK Mount DSLR new H260 $2.82 |
|
|
52MM 0.45X WIDE ANGLE MACRO + LENS ADAPTER FOR NIKON P5000 P5100 $25.49 |
|
|
0.45X SOFT FISHEYE LENS + MACRO + TUBE ADAPTER FOR NIKON P5100 52MM $25.49 |
|
|
52MM WIDE ANGLE 0.45X MACRO LENS + TUBE ADAPTER FOR PANASONIC DMC-LX3 $19.99 |
|
|
0.45X SOFT FISHEYE WIDE ANGLE MACRO LENS ADAPTER FOR KODAK DX7440 Z730 $19.99 |
|
|
52mm Macro Reverse Adapter Ring for Nikon AF AI mount $1.45 |
|
|
55mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
58mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
62mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
67mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
72mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
77mm Macro Reverse Adapter Ring for Nikon AF AI mount $0.88 |
|
|
F165 macro o flash ring adapter for Canon 430EX II50D 40D 30D 20D $32.00 |
|
|
SYSTEM 3R Manual chuck adapter, Macro/Mini 3R-653 EDM $999.00 |
|
|
MANDEE Canon EOS to Canon FD Macro Converter Lens Adapter Filter Kit Brand New $0.99 |
|
|
2.0X TELEPHOTO LENS + 0.43X FISHEYE MACRO + TUBE ADAPTER FOR NIKON L110 $59.99 |
|
|
MACRO CANON LENS FL 50mm 1:3.5 LIFE SIZE ADAPTER SLR CAMERA CAPS CASE CLEAN f=50 $199.00 |
|
|
52mm Macro Reverse Adapter Ring for CANON EOS EF Mount $6.99 |
|
|
55 MM 55MM Macro Reverse Mount Adapter For Nikon F AF $3.99 |
|
|
NIKON BR-2 MACRO ADAPTER RING $12.95 |
|
|
58 MM 58MM Macro Reverse Mount Adapter For Nikon F AF $3.99 |
|
|
2X TELEPHOTO 0.45X WIDE MACRO LENS UV FOR CANON A620 CAMERA ADAPTER TUBE $38.99 |
|
|
MEOPTA MAKRO AXOMAT Ia macro adapter Enlarger Photograph New in Original Case $30.00 |
|
|
62 MM 62MM Macro Reverse Mount Adapter For Nikon F AF $4.99 |
|
|
67 MM 67MM Macro Reverse Mount Adapter For Nikon F AF $4.99 |
|
|
72 MM 72MM Macro Reverse Mount Adapter For Nikon F AF $4.99 |
|
|
77 MM 77MM Macro Reverse Mount Adapter For Nikon F AF $4.99 |
|
|
macro minolta md adapter 4 Canon 30d 40d 400d 350d 50d $16.95 |
|
|
Raynox Universal Adapter (52-67mm) RAY UAC 3500 for 37mm Macro Lens or 37mm lens $14.99 |
|
|
52mm to 58mm Male Macro Coupler Reverse LENS REVERSAL Adapter Ring 4 CLOSE UP $4.49 |
|
|
T Mount T-Mount Adapter Panasonic G1 GH1 Macro 4/3 G-1 $12.99 |
|
|
52mm 52 macro reverse adapter ring f Canon 1D 5D II 50D $3.20 |
|
|
52mm 52 macro reverse adapter ring f Canon XS XSi T1i $3.20 |
|
|
52mm macro reverse adapter ring f Nikon D700 D300 D3x $3.20 |
|
|
52mm macro reverse adapter ring f Nikon D80 D90 D5000 $3.20 |
|
|
58mm 58 macro reverse adapter ring f Canon XS XSi T1i $3.20 |
|
|
58mm macro reverse adapter ring f Nikon D700 D300 D3x $3.20 |
|
|
67mm Macro Reverse Adapter Ring for Nikon Camera Mount $7.84 |
|
|
52mm to 55mm Male Macro Coupler Reverse LENS REVERSAL Adapter Ring CLOSE UP $4.49 |
|
|
Fun FishEye Effects+MACRO Adapter for Canon T2i+18-55mm $39.95 |
|
|
Raynox Universal Adapter (52-67mm) RAY UAC 2000 for 43mm Macro Lens or 43mm lens $14.99 |
|
|
55mm 55 mm Macro Reverse Mount Adapter Ring for Pentax PK K DSLR SLR camera $7.06 |
|
|
CANON MACRO LENS FL 50MM 1: 3.5 + LIFE SIZE ADAPTER + CASE + MANUAL BUNDLE ++++ $99.95 |
|
|
LEICA M Lens to SONY NEX E-mount Camera MACRO TUBE HELICOID ADAPTER $79.99 |
|
|
Raynox DCR-250 MACRO LENS + CAMERA ADAPTER for NIKON COOLPIX L100 L110 67mm $84.95 |
|
|
Paintball Gun Macroline Macro Line Drop Forward Tank Adapter Hose Kit and Elbow $13.95 |
|
|
2X TELE 0.45X WIDE ANGLE MACRO LENS FOR CANON G12 G10 CAMERA ADAPTER TUBE $42.74 |
|
|
0.43X WIDE FISHEYE MACRO LENS ADAPTER RING MICROFIBER FOR CAMERA LENS 52 55MM $37.99 |
|
|
Nikon BR-2 BR2 Macro Adapter Ring for Bellows Atttachment Model 2 $17.00 |
|
|
WIDE ANGLE FISHEYE + MACRO LENS + TUBE ADAPTER FOR NIKON P5000 P5100 $43.69 |
|
|
WIDE ANGLE MACRO LENS 0.43X + ADAPTER FOR CANON POWERSHOT CAMERA G10 G11 G12 $44.64 |
|
|
Wide angle lens 0.43x with macro + lens adapter + UV CPL FLD for Sony DSC-HX1 $71.24 |
|
|
Wide angle lens 0.43x with macro + UV CPL FLD + lens adapter for Sony DSC-HX1 $72.19 |
|
|
Metz 67mm Adapter Ring for 15 MS-1 Macro-Flash $16.00 |
|
|
NICE USED FD CANON MACRO 50mm f3.5 LENS BUNDLE LIFE SIZE ADAPTER 4 CANON CAMERA $89.00 |
|
|
0.43X FISHEYE MACRO LENS +UV FILTER FOR KODAK P850 P712 CAMERA ADAPTER TUBE $37.49 |
|
|
Macro coupling Reverse Ring Adapter 74-74 mm 74mm-74mm $4.65 |
|
|
Macro coupling Reverse Ring Adapter 52-52 mm 52mm-52mm $4.65 |
|
|
Macro coupling Reverse Ring Adapter 55-55 mm 55mm-55mm $4.75 |
|
|
LEICA M Lens To SONY NEX E-mount MACRO TUBE HELICOID Adapter $79.99 |
|
|
Macro Adapter for ARRI Shift & Tilt Lens System – Used $450.00 |
|
|
Macro coupling Reverse Ring Adapter 67-67 mm 67mm-67mm $4.75 |