Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;**** DATA ***
- cpt: db 0
- xpos: db 0
- print:
- MOV byte [cpt], 0
- .aff:
- MOV DL,[ESI]
- CMP DL, 10
- JNE .continue
- CALL enter
- JMP .fin
- .continue
- CMP DL,0
- JE .fin
- call putchar
- INC ESI
- INC byte [cpt]
- JMP .aff
- .fin:
- MOV EAX, [cpt]
- RET
- print80:
- MOV byte [cpt], 0
- .aff:
- MOV DL,[ESI]
- CMP DL, 10
- JNE .continue
- CALL enter
- JMP .fin
- .continue
- CMP DL,0
- JE .fin
- CMP ECX, 0
- JE .fin
- DEC ECX
- call putchar
- INC ESI
- INC byte [cpt]
- JMP .aff
- .fin:
- MOV EAX, [cpt]
- RET
- putchar:
- pusha
- xor eax,eax ; Mise à 0 de EAX
- mov byte al,[xpos] ; On place dans AL la position de X que
- mov bl,2 ; l'on multiplie par 2 car le caractère est
- mul bl ; sur le 1er byte, la couleur sur le 2ème
- add eax,0xB8000+80*2*24 ; On ajoute B8000(mémoire vidéo) et la ligne 24 de l'écran
- mov edi,eax
- MOV DH,0x0F
- MOV [EDI],DX ; On place le caractère lu dans EDI
- call decalx
- popa
- RET
- enter:
- MOV byte [xpos], 79
- call scrollup
- MOV byte [xpos], 0
- RET
- scrollup:
- MOV ESI,0xB8000+80*2
- MOV EDI,0xB8000
- MOV ECX,0xFA0-80*2
- REP MOVSB
- MOV al,0x0
- MOV EDI,0xB8FA0-80*2
- MOV ECX,80*2
- REP STOSB
- RET
- clear:
- MOV al,0x0
- MOV EDI,0xB8000
- MOV ECX,0xFA0
- REP STOSB
- RET
- back:
- call decalxg
- mov dl,' '
- call putchar
- call decalxg
- RET
- decalx:
- cmp byte [xpos],79
- JNZ .decalun
- call scrollup
- mov byte [xpos],0
- jmp .endecal
- .decalun:
- inc byte [xpos]
- .endecal:
- RET
- decalxg:
- cmp byte [xpos],0
- JNZ .decalun
- call scrollup
- mov byte [xpos],79
- jmp .endecal
- .decalun:
- dec byte [xpos]
- .endecal:
- RET
Advertisement
Add Comment
Please, Sign In to add comment