KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD
KING'S IT WORLD
Would you like to react to this message? Create an account in a few clicks or log in to continue.

KING'S IT WORLD


 
HomeHome  GalleryGallery  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  
Search
 
 

Display results as :
 
Rechercher Advanced Search
kings it world text ad
KINGSITWORLD CALENDAR
Follow me on G+
KINGSITWORLD WEATHER
Latest topics
» QURAN MAJEED KE TAFSEER
assignment no 5 solution of cs4-1 Icon_minitimeMon Aug 20, 2012 2:59 am by YOUSUFHALI

» PHY301 CIRCUIT THEORY REFERENCE BOOK
assignment no 5 solution of cs4-1 Icon_minitimeWed Jul 25, 2012 11:36 am by shabbir1915

» MTH202 ASSIGNMENT NO 3 SOLUVED
assignment no 5 solution of cs4-1 Icon_minitimeMon Jun 11, 2012 9:51 am by jaffarhussain

» Retrieve the DTC In the Jewel Module of 1995 Ford
assignment no 5 solution of cs4-1 Icon_minitimeThu May 31, 2012 11:51 am by obd2tool

» How you can Obvious the Check Engine Light on the
assignment no 5 solution of cs4-1 Icon_minitimeThu May 31, 2012 11:43 am by obd2tool

» send free sms and send free sms update on facebook
assignment no 5 solution of cs4-1 Icon_minitimeTue May 15, 2012 8:33 pm by rizwan269

» United Bank Limited (UBL) - Fee Deposit
assignment no 5 solution of cs4-1 Icon_minitimeThu May 10, 2012 3:33 pm by irumnaz

» PHOTO MIXER SOFTWARE
assignment no 5 solution of cs4-1 Icon_minitimeFri Apr 20, 2012 10:02 am by sacredwkb

» Entrepreneurship Survey
assignment no 5 solution of cs4-1 Icon_minitimeThu Mar 08, 2012 2:20 pm by Admin

» Fall 2011 Semester Result Announced
assignment no 5 solution of cs4-1 Icon_minitimeThu Mar 08, 2012 2:19 pm by Admin

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
kings it world text ad
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website
visitors counter
assignment no 5 solution of cs4-1 Image
Powered by website analytics technology.
Keywords
2010 MGT502 2011 assignment HRM611 final paper term MGMT611
kings it world text ad
FLAG COUNTER
free counters
LIVE TRAFFIC

 

 assignment no 5 solution of cs4-1

Go down 
AuthorMessage
Admin
Admin
Admin


Scorpio
Posts : 638
Points : 2155
Reputation : 19
Join date : 2010-05-15
Age : 36
Location : islamabad

assignment no 5 solution of cs4-1 Empty
PostSubject: assignment no 5 solution of cs4-1   assignment no 5 solution of cs4-1 Icon_minitimeTue Jul 13, 2010 2:14 pm

Code:

[org 0x0100]
jmp start
seconds: dw 0
timerflag: dw 0
oldkb: dd 0
; subroutine to print a number at center of screen
printnum: push bp
mov bp, sp
push es
push ax
push bx
push cx
push dx
push di
mov ax, 0xb800
mov es, ax ; point es to video base
mov ax, [bp+4] ; load number in ax
mov bx, 10 ; use base 10 for division
mov cx, 0 ; initialize count of digits
nextdigit: mov dx, 0 ; zero upper half of dividend
div bx ; divide by 10
add dl, 0x30 ; convert digit into ascii value
push dx ; save ascii value on stack
inc cx ; increment count of values
cmp ax, 0 ; is the quotient zero
jnz nextdigit ; if no divide it again
mov di, 70 ; point di to 35th column
nextpos: pop dx ; remove a digit from the stack
mov dh, 0x07 ; use normal attribute
mov [es:di], dx ; print char on screen
add di, 2 ; move to next screen location
loop nextpos ; repeat for all digits on stack
pop di
pop dx
pop cx
pop bx
pop ax
pop es
pop bp
ret 2
; keyboard interrupt service routine
kbisr: push ax
in al, 0x60 ; read char from keyboard port
cmp al, 0x41 ; has the Capital A pressed
jne nextcmp ; no, try next comparison
cmp word [cs:timerflag], 1; is the flag already set
je exit ; yes, leave the ISR
mov word [cs:timerflag], 1; set flag to start printing
jmp exit ; leave the ISR
nextcmp: cmp al, 0x42 ; has the Capital B pressed
jne nomatch ; no, chain to old ISR
mov word [cs:timerflag], 0; reset flag to stop printing
jmp exit ; leave the interrupt routine
nomatch: pop ax
jmp far [cs:oldkb] ; call original ISR
exit: mov al, 0x20
out 0x20, al ; send EOI to PIC
pop ax
iret ; return from interrupt
; timer interrupt service routine
timer: push ax
cmp word [cs:timerflag], 1 ; is the printing flag set
jne skipall ; no, leave the ISR
inc word [cs:seconds] ; increment tick count
push word [cs:seconds]
call printnum ; print tick count
skipall: mov al, 0x20
out 0x20, al ; send EOI to PIC
pop ax
iret ; return from interrupt
start: xor ax, ax
mov es, ax ; point es to IVT base
mov ax, [es:9*4]
mov [oldkb], ax ; save offset of old routine
mov ax, [es:9*4+2]
mov [oldkb+2], ax ; save segment of old routine
cli ; disable interrupts
mov word [es:9*4], kbisr ; store offset at n*4
mov [es:9*4+2], cs ; store segment at n*4+2
mov word [es:8*4], timer ; store offset at n*4
mov [es:8*4+2], cs ; store segment at n*4+
sti ; enable interrupts
mov dx, start ; end of resident portion
add dx, 15 ; round up to next para
mov cl, 4
shr dx, cl ; number of paras
mov ax, 0x3100 ; terminate and stay resident
int 0x21.

Back to top Go down
 
assignment no 5 solution of cs4-1
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
KING'S IT WORLD :: EDUCATION :: ASSIGNMENTS-
Jump to: