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 143 144 145 146 147 148 149 150
| org 256
%define Num 10
%define SegIvt 0
%define NbreInt 16
%define total Num+NbreInt
%macro affiche 4
;affiche en ram vga texte 80*25
;x=%1 y=%2 Lptext=%3 couleur=%4
mov si,%3
mov bx,%1
mov di,%2
mov ah,%4
call VGA3
%endmacro
section .data
NumINT dw 0
Buff db '0000',0
inter db 'INT ',0
ptv db ':',0
Y resw 1
Y160 resw 1
section .text
push word SegIvt
pop es ;es pointe sur l'IVT
push 0B800h
pop fs ;fs pointe sur ram vga texte
mov ax,03h
int 10h ;mode VGA texte 80*25 16 couleurs
mov ax,3
mov [Y],ax ;debut affichage en Y=3
mov ax,Num
mov [NumINT],ax
boucle:
mov ax,[Y]
mov bx,160
mul bx
mov [Y160],ax
mov bx,[NumINT]
mov di,Buff
call AFFval
affiche 2,word[Y160],inter,100b
affiche 7,word[Y160],Buff,100b
mov si,[NumINT]
shl si,2
mov ax,[es:si]
xchg bx,ax
mov di,Buff
call AFFval
affiche 38,WORD[Y160],ptv,110b
affiche 39,word[Y160],Buff,110b
mov si,[NumINT]
shl si,2
mov ax,[es:si+2]
xchg bx,ax
mov di,Buff
call AFFval
affiche 34,word[Y160],Buff,110b
inc word[Y]
inc word[NumINT]
mov ax,[NumINT]
xor ax,total
jnz boucle
mov ah,0
int 16h
ret
VGA3:
pushad
shl bx,1
VGA3_debut:
lodsb
cmp al,0 ;zéro terminal ?
jz VGA3_fin
mov [fs:di+bx],ax
inc bx
inc bx
jmp VGA3_debut
VGA3_fin:
popad
ret
AFFval:
pushad
;bits 15 à 12
push bx
shr bh,4
xchg bh,bl
call cherche
pop bx
;bits 11 à 8
push bx
and bh,00001111b
xchg bh,bl
call cherche
pop bx
;bits 7 à 4
push bx
shr bl,4
call cherche
pop bx
;bit 3 à 0
and bl,00001111b
call cherche
popad
ret
cherche:
add bl,48
cmp bl,58
jc stocke
add bl,7
stocke:
mov [di],bl
inc di
ret |
Partager