1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
| include io.inc .model small .stack .data intmsg3 byte 'TPCA Interrupt No.3!',0dh,0ah,0 intmsg10 byte 'TPCA Interrupt No.10!',0dh,0ah,0 counter byte 0 .code start: mov ax,@data mov ds,ax mov ax,350Bh int 21h push es push bx cli push ds mov ax,seg new0Bh mov ds,ax mov dx,offset new0Bh mov ax,250Bh int 21h pop ds in al,21h push ax and al,0f7h out 21h,al mov counter,0 sti
mov ax,@data mov ds,ax mov ax,3572h int 21h push es push bx cli push ds mov ax,seg new72h mov ds,ax mov dx,offset new72h mov ax,2572h int 21h pop ds in al,0a1h push ax and al,0fbh out 0a1h,al mov counter,0 sti start1: cmp counter,5 jb start1 cli pop ax out 21h,al pop dx pop ds mov ax,2572h int 21h sti
cli pop ax out 21h,al pop dx pop ds mov ax,250Bh int 21h sti .exit 0
new72h proc sti push ax push si push ds mov ax,@data mov ds,ax inc counter mov si,offset intmsg10 call dpstri
mov ah,86h mov cx,0ffh mov dx,8480h int 15h
mov al,20h out 0a0h,al out 20h,al pop ds pop si pop ax iret new72h endp
new0Bh proc sti push ax push si push ds mov ax,@data mov ds,ax inc counter mov si,offset intmsg3 call dpstri mov al,20h out 20h,al pop ds pop si pop ax iret new0Bh endp
dpstri proc push ax push bx push cx push dx dps1: mov al,[si] cmp al,0 jz dps2 mov bx,0 mov ah,0eh int 10h inc si jmp dps1 dps2: mov ah,86h mov cx,0ffh mov dx,8480h int 15h pop dx pop cx pop bx pop ax ret dpstri endp end start
|