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
| ;NASM-IDE ASM Assistant Assembler Project File
[BITS 16] ;Set code generation to 16 bit mode
[ORG 0x0100] ;Set code start address to 0100h
jmp debut
aff_bin:
push cx
push es
mov cx , 01000b
push word 0b800h
pop es
line:
inc bx
inc bx
rol al , 1
jb line2
mov [es:bx] , word 000001100110000b
jmp suit
line2:
mov [es:bx] , word 000001100110001b
suit:
loop line
pop es
pop cx
ret
aff_ascii:
push ax
push es
push bx
mov ax , 0b800h ; adresse du mode d'criture
mov es , ax ; passage dans es
mov ah , 010b ; couleur du text (2=vert)
xor bx , bx ; mise
zero de dx (fonction logique)
line3:
mov al , [di+bx] ; passe au n ime charactre (bx)
mov [es:si] , ax ; ecrit le charactre
inc bx ; pour passer au charactre suivant
inc si ; inscremente de 1 si
inc si ; inscremente de 1 si place du charactre (word 2)
loop line3
pop bx
pop es
pop ax
ret
debut:
mov al , [80h] ; nombre de charactres
lire
mov bx , 142 ; position de dpart pour l'criture (fin premire ligne)
call aff_bin ; ecriture en bin
cmp al , 0 ; si charactre alors il affiche
je fin
xor cx , cx ; mise a 0
mov cl , al ; nombres de charactres
mov di , word 81h ; adresse de dpart de lecture
mov si , 320 ; position de dpart pour l'criture (3ø ligne)
call aff_ascii
fin:
mov ah , 4ch
int 21h |
Partager