Académique Documents
Professionnel Documents
Culture Documents
mov dl,10 ;set int 21h ;print mov dl, 13 ;set int 21h ;print
sub bh, 1 ;increase value of bh by 1 pop dx ;restore value of dx push bx ;restore value of bx cmp bh,1 ;compare value of bh je exit ;if bh is equal to the character 7, end program jmp initial ;else, go to initial exit: int 20h main endp end
int 21h ;print a new line mov dl, 13 ;set value carriage return to dl int 21h ;print carriage return add bh, 1 ;increase value of bh by 1 pop dx ;restore value of dx push bx ;restore value of bx cmp bh,07 ;compare value of bh je exit ;if bh is equal to the character 7, end program jmp initial ;else, go to initial exit: int 20h main endp end
mov ah, 02 mov dl, 31h ;for number 1 mov bl, 01 ;set initial count mov bh, 02 ;set initial count limit push bx ;preserve value of bx start: int 21h ;display value of dl inc bl ;increase value of bl by 1 cmp bl,bh ;compare bl and bh jne start ;if not equal, go to start pop bx push dx ;restore value of bx ;preserve value of dx value new line to dl a new line value carriage return to dl carriage return
mov dl,10 ;set int 21h ;print mov dl, 13 ;set int 21h ;print
add bh, 1 ;increase value of bh by 1 pop dx ;restore value of dx inc dl ;increase value of dl by 1 push bx ;restore value of bx cmp dl,36h ;compare value of dl je exit ;if dl is equal to the character 6, end program jmp start ;else, go to start exit: int 20h main endp end
cmp bl,bh ;compare bl and bh jne start ;if not equal, go to start pop bx push dx ;restore value of bx ;preserve value of dx value new line to dl a new line value carriage return to dl carriage return
mov dl,10 ;set int 21h ;print mov dl, 13 ;set int 21h ;print
sub bh, 1 ;decrease value of bh by 1 pop dx ;restore value of dx dec dl ;decrease value of dl by 1 push bx ;restore value of bx cmp dl,30h ;compare value of dl je exit ;if dl is equal to the character 0, end program jmp start ;else, go to start exit: int 20h main endp end
mov ah, 02 mov dl, 61h start: sub dl,20h int 21h push dx mov dl, 0AH int 21h pop dx add dl, 20h inc dl cmp dl, 79H jne start int 20h main endp end