Rechercher dans ce blog

jeudi 31 mars 2011

Daily Game Mar 31 - Red Dragon Rampage

Protect your big old daddy from the waves of enemies trying to take him down.

Red Dragon Rampage is powered by dailygame.org

mercredi 30 mars 2011

Daily Game Mar 30 - BinB

Defeat all the monsters to gain access to the next level in a classic style arcade game.

BinB is powered by dailygame.org

mardi 29 mars 2011

Daily Game Mar 29 - DarkBase: Alien RTS

The DarkBase marines started the war and now it's up to the aliens to put an end to it!

DarkBase: Alien RTS is powered by dailygame.org

lundi 28 mars 2011

Daily Game Mar 28 - Infinite Tower RPG

Climb the infinite tower as a rogue, axeman or knight.

Infinite Tower RPG is powered by dailygame.org

dimanche 27 mars 2011

Daily Game Mar 27 - Ninja Time Trials

Ascend your way to heaven using your bungee rope.

Ninja Time Trials is powered by dailygame.org

samedi 26 mars 2011

Daily Game Mar 26 - The Squirrel Game

Play as a squirrel fleeing from all sorts of weird scenarios.

The Squirrel Game is powered by dailygame.org

vendredi 25 mars 2011

Daily Game Mar 25 - Tetris Labs

Get to the flower in each level by controlling the test subject and using the tetris blocks to your advantage.

Tetris Labs is powered by dailygame.org

jeudi 24 mars 2011

Daily Game Mar 24 - Not Your War

Fly your ship through a world torn by war and gun down swarms of enemies.

Not Your War is powered by dailygame.org

mercredi 23 mars 2011

Daily Game Mar 23 - DuoBlaster

Complete 9 levels, alone or with a partner, of sidescrolling space shooting action.

DuoBlaster is powered by dailygame.org

mardi 22 mars 2011

Daily Game Mar 22 - Tsunami Fighter

Fight the tsunami waves by mashing the correct buttons.

Tsunami Fighter is powered by dailygame.org

lundi 21 mars 2011

Daily Game Mar 21 - Cover Orange Players Pack 2

Play the 2nd player's pack of the popular "Cover Orange" game.

Cover Orange Players Pack 2 is powered by dailygame.org

vendredi 18 mars 2011

Daily Game Mar 18 - ZitS the Saviour - act1

Take out zombies in a top-down thriller/shooter with RPG elements.

ZitS the Saviour - act1 is powered by dailygame.org

jeudi 17 mars 2011

Daily Game Mar 17 - Teelonians:Clan Wars

Lead the Teelonian clan to victory against the invaders.

Teelonians:Clan Wars is powered by dailygame.org

mercredi 16 mars 2011

mardi 15 mars 2011

Daily Game Mar 15 - Mad Bombs

Light your bombs up and run them to the zombie pirates!

Mad Bombs is powered by dailygame.org

lundi 14 mars 2011

Daily Game Mar 14 - Cactus McCoy

Cursed by an ancient jewel Mccoy must bring it to it's resting place before it turns him to stone.

Cactus McCoy is powered by dailygame.org

dimanche 13 mars 2011

Daily Game Mar 13 - Another Cave Runner

Run through the cave in story mode or perpetual mode in a fun "Canabalt" style game.

Another Cave Runner is powered by dailygame.org

samedi 12 mars 2011

Daily Game Mar 12 - Power Fox 4

Fight the gods as the all-mighty Powerfox!

Power Fox 4 is powered by dailygame.org

vendredi 11 mars 2011

Daily Game Mar 11 - Notebook Wars 2

Beat 13 levels of fun notebook styled plane shooter.

Notebook Wars 2 is powered by dailygame.org

jeudi 10 mars 2011

Daily Game Mar 10 - Hambo

Help Hambo save his friend Bacon from going to prison.

Hambo is powered by dailygame.org

mercredi 9 mars 2011

Daily Game Mar 09 - Go Go Sunshine

Bring sunshine to the people by jumping on the rain clouds.

Go Go Sunshine is powered by dailygame.org

mardi 8 mars 2011

Daily Game Mar 08 - ShellShock Live v1.0+

Create an account and shoot other players online in a tank versus tank battle.

ShellShock Live v1.0+ is powered by dailygame.org

lundi 7 mars 2011

Daily Game Mar 07 - Snow White 2: Back To Life

Continue Snow White's journey to the wicked queen's castle and take your revenge!

Snow White 2: Back To Life is powered by dailygame.org

dimanche 6 mars 2011

Daily Game Mar 06 - Sushi Cat 2

Continue the tale of Sushi Cat as he eats his way to get back his love.

Sushi Cat 2 is powered by dailygame.org

samedi 5 mars 2011


Tp assembleur


TP 2

Introduction

Macros
Une macro-instruction ou macro est une séquence d'instructions et de directives que
l'assembleur traite quand il rencontre le nom de la macro dans un programme. Il crée
alors habituellement du nouveau code source. Cette facilité peut être utilisée comme une
sorte de sténographie pour le programmeur. On remplace du code fréquemment utilisé
par une macro. Ceci rend le code source plus rapide à écrire et plus compact. Le code
objet n'est cependant pas plus court que si l'on n'utilisait pas de macros, contrairement à
un sous-programme utilisé plusieurs fois dans un programme.
nom MACRO [[paramètre [[.REQ | :=default | :VARARG]] ]]...
Indique le début de la définition d'une macro appelée nom.
ENDM [[valeur]]
Indique la fin de la définition d'une macro. Retourne valeur à l'énoncé appelant.
EXITM
Branche à l'énoncé qui suit la macro.
LOCAL nom
Utilisée pour créer une étiquette nom à l'intérieur d'une macro.
Code Source


.model small
.stack 100H 
.data             
msg db  "  donnez la chaine de carcteres qui se termine par le caractere *  ","$"                                                          
msg2 db " ; la taille de chaine est:  ","$"
msg3 db " ; le nombre de separateur est:  ","$"
msg4 db " ; le nombre de mot est:  ","$"
msg5 db " ; le caractere le plus recurrent est:  ","$"
msg6 db " ; il n'ya pas de mot car la chaine est vide:  ","$"
msg7 db " ; le mot le plus lang est:  ","$"
msg8 db " ; il n'y a pas de mot car une chaine des separateur:  ","$"
msg9 db " ; iln'y a pas de caractere recurrent car la chaine est vide:  ","$"
chcar db 200 dup ("$")
langch dw ?
nbseparateur dw ?
nbmots dw ?
lecaracter db ?
ltrouve dw ?
ind1trouve dw ?
ind2trouve dw ?
.code  
;remplisage   
saisie macro t                  
         mov ah,9
         lea dx,msg
         int 21h  
         mov si,0      
     remplire:
            mov ah,1
            int 21h 
            mov t[si],al
            inc si
            cmp al,"*"
            jne remplire
endm            
;la taille de la chaine de caracter
taille macro tai,t

     mov bp,0
          mov si,0
    tantque:
            mov bl,t[si]
            cmp bl,"*"
            je fintantque
            inc bp
            inc si
            jmp tantque
    fintantque:
    mov tai,bp
    mov ah,9
    lea dx,msg2
    int 21h
    mov ax,bp
    mov cl,10
    div cl
    mov bl,ah
    mov ah,2
    mov dl,al
    add dl,48
    int 21h
    mov ah,2
    mov dl,bl
    add dl,48       
    int 21h
endm
;le nombre de mots
Nmots macro lch,nm,t
mov bx,0
mov bp,lch
for: mov si,1
     jmp test
next:
  if: cmp t[si],' '
       je et
      cmp t[si],','
       je et
      cmp t[si],';'
       je et
      cmp t[si],"'"
       je et
      cmp t[si],'.'
       je et
      cmp t[si],':'
       je et
     jmp endif
    et:
      mov di,si
      sub di,1
      cmp t[di],' '
       je endif
      cmp t[di],','
       je endif
      cmp t[di],';'
       je endif
      cmp t[di],"'"
       je endif
      cmp t[di],'.'
       je endif
      cmp t[di],':'
       je endif
     alore: add bx,1
    endif:
    inc si
test: cmp si,bp
      jl next
endfor:
 mov cx,lch
 sub cx,1
 mov si,cx

 if2: cmp lch,0
       je endif2
      cmp t[si],' '
       je endif2
      cmp t[si],','
       je endif2
      cmp t[si],';'
       je endif2
      cmp t[si],"'"
       je endif2
      cmp t[si],'.'
       je endif2
      cmp t[si],':'
       je endif2
 alore2: add bx,1 
 endif2:
 mov nm,bx
mov ah,9
mov dx,offset msg4
int 21h 
mov ax,nm
mov cl,10
div cl
mov bl,ah
mov ah,2
mov dl,al
add dl,48
int 21h
mov ah,2
mov dl,bl
add dl,48
int 21h   
endm
;le mot le plus lang
motpl macro lch,t
mov ltrouve,0
si33: cmp lch,0
    je finsi33
for33: mov si,0
     jmp test33
next33:
     si23:cmp t[si],' '
          je finsi23
          cmp t[si],','
          je finsi23
          cmp t[si],';'
          je finsi23
          cmp t[si],':'
          je finsi23
          cmp t[si],'.'
          je finsi23  
     mov cx,0 ;lmot dans cx
     mov ax,si ;ind1 dans ax
      repeter33: 
     add si,1
     add cx,1
    
     cmp t[si],' '
     je finrepeter33
     cmp t[si],','
     je finrepeter33
     cmp t[si],';'
     je finrepeter33
     cmp t[si],':'
     je finrepeter33
     cmp t[si],'.'
     je finrepeter33     
     cmp si,lch
     jnl finrepeter33    
     jmp repeter33    
     finrepeter33:    
     mov bx,si
     sub bx,1 ;ind2 dans bx  
     si332:cmp cx,ltrouve
         jng finsi332
         mov ind1trouve,ax
         mov ind2trouve,bx
         mov ltrouve,cx
     finsi332:  
      finsi23:    
     inc si
test33:  cmp si,lch
       jl next33
endfor33:
finsi33:
;affichage du mot le plus lang
if44: cmp lch,0
      jne tdsepa
         mov ah,9
         lea dx,msg6
         int 21h
      jmp endif44
tdsepa:mov di,ind1trouve
         cmp t[di]," "
         je tds
         cmp t[di],"'"
         je tds
         cmp t[di],","
         je tds
         cmp t[di],"."
         je tds
         cmp t[di],";"
         je tds
         cmp t[di],":"
         je tds
       mov di,ind2trouve
         cmp t[di]," "
         je tds
         cmp t[di],"'"
         je tds
         cmp t[di],","
         je tds
         cmp t[di],"."
         je tds
         cmp t[di],";"
         je tds
         cmp t[di],":"
         je tds
         jmp else44
   tds: mov ah,9
        lea dx,msg8
        int 21h
        jmp endif44    
else44:
         mov ah,9
         lea dx,msg7
         int 21h
      for44: mov di,ind1trouve
             jmp test44
      next44:
        mov ah,2
        mov dl,t[di]
        int 21h
            inc di
      test44: cmp di,ind2trouve
             jle next44
      endfor44:
endif44:        
endm
;nombre de separateur
nseparateur macro lch,ns,t   
 mov ax,lch
 mov si,0
 mov bp,0
 repeter1:
switch:cmp t[si],' '
       jne case1 
       add bp,1     
case1: cmp t[si],','
       jne case2     
       add bp,1     
case2: cmp t[si],';'
       jne case3               
       add bp,1     
case3: cmp t[si],'.'
        jne case4
       add bp,1
case4: cmp t[si],"'"
       jne case5
       add bp,1      
case5: cmp t[si],':'
       jne default      
        add bp,1            
default: add bp,0
inc si               
cmp si,ax
jl repeter1 
mov ns,bp
;affichage du nombre de separateur
mov ah,9
mov dx,offset msg3
int 21h 
mov ax,bp
mov cl,10
div cl
mov bl,ah
mov ah,2
mov dl,al
add dl,48
int 21h
mov ah,2
mov dl,bl
add dl,48
int 21h
endm
;le caracter le plus recurent
recurrent macro lch,lecar,t
mov ax,lch     
mov cx,0
mov si,0
mov bx,0
repeter2:
mov bp,0
mov dl,t[si]
mov di,0
 repeter22:
    if4:cmp dl , t[di]
        jne endif4
    alors:add bp,1
          jmp endif4
    endif4:
    inc di
    cmp di,ax
 Jl repeter22
 if3:cmp bp,cx
     jle endif3
 then:mov cx,bp
      mov bl,t[si]
      jmp endif3
 endif3:
 inc si
 cmp si,ax
Jl repeter2 

mov lecar,bl
;affichage du caracter le plus recurrent
cmp bl,"*"
    jne affi 
    mov ah,9
    mov dx,offset msg9
    int 21h
    jmp fin
affi:    
mov ah,9
mov dx,offset msg5
int 21h                 
mov ah,2
mov al,bl
mov dl,al
int 21h
fin:
endm
   main proc    
         mov ax,@data
         mov ds,ax       
   saisie chcar
   taille langch,chcar
   Nmots  langch,nbmots,chcar
   motpl  langch,chcar 
   nseparateur langch,nbseparateur,chcar
   recurrent langch,lecaracter,chcar
    mov ax, 0 ;attendre l'utilisateur pour terminer le programme
    int 16h                  
.exit
main endp
end main 

Demarche

On a écrit le code source sur le wordpad pius on la enregistré sous une extension (.asm) dans le dossier c:\tasm\bin
Puis on à utuliser l’invite de commande qui est accessible à partir de menu demarrer comme suit :
Demarrer\exécuter\cmd
Puis on a écrit  Cd tasm\bin
On a  Tapé   : 1-tasm32 sh.asm
                         2- tlink sh.obj
                        3-Pour tester le programme on tape  : sh.exe
Conclusion
Un programme developpé en langage asembleur est un programme assez rapide au niveau de l’exécution qu’un autre programme developpé avec un langage evolué, en effet un langage assembleur est très proche  de la machine et il occupe le moindre espace mémoire. Ne moins sa programmation est tres defficile à  métrisé.