.xlist if1 %out BOOTTI.ASM k„„nnet„„n parastaikaa... :-) %out %out Ei kest„ yht„„n aikaa, niin jo on valmit %out %out n„„ alkujutut vaan esimerkin vuoksi endif if2 %out *** PASS 2 menossa jo.. „l„ h„t„ile %out %out t„ss„ assyssa on t„ll„si„ kivoja juttuja.. endif name BOOTTI title BOOTTAA KONEEN NOIN 4 SEK PŽŽSTŽ LATAUKSESTA. subttl OHJELMOINUT JAAKKO TAMMINEN. page 66,132 .list ; ************************************************************************ ; ** ** ; ** filename: bootti.asm ** ; ** ** ; ************************************************************************ assume cs:code ; annetaan assylle tiedoksi, ett„ CS ja ASSUME ds:code ; ja DS on k„ytett„viss„ code segment public org 100H ; asetetaan ohjelman alkukohdan offsetti pgm: jmp start ; „l„ aja dataa laskuri dw 1 dup(0ffh) ; t„m„ on dataa! intti proc far ; THE resident push ax mov ax,laskuri ; get counter dec ax ; decrease it by one cmp ax,0 ; is it zero je bootti ; yes, boot jmp poistu ; no, exit bootti: ; now the uqly way to jump to some address... ; saves one double-word of data-area :) mov ax,0f000h ; boot-segment push ax ; push it to stack mov ax,0fff0h ; boot-offset push ax ; push it to stack ret ; return, take address from stack poistu: mov laskuri,ax ; store decreased laskuri pop ax ; restore ax iret ; and return from interrupt loppupaikka equ $ ; for limiting resident code-size intti endp ; eop of interrupt start: ; initalize data, and make resident active mov ax,0fh mov laskuri,ax ;laskuri asetettu cli mov dx,offset intti mov ah,025h mov al,01Ch ; use interrupt 1c instead of 08h, because ; no need for pushf/call old_interrupt then. int 21h ;intti asetettu sti lea dx,loppupaikka ; limit resident size to almost nothing int 27h ; terminate and stay ressu code ends end pgm