All pastes #403442 Raw Edit

Morbid

public text v1 · immutable
·published 2007-03-20 11:31 UTC
rendered paste body

global main

section .data

  tableau	db	1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
  position	db	4

  msgOk		db	"Ok"
  msgFaux	db	"Faux"
  chariot	db	10

section .bss

  chifTab	resb	1

section .text

main :

  mov eax,dword [tableau]	; on met l'adresse du premier element du tableau dans eax
  add eax,dword [position]	; pour aller au 4 eme élément du tableau
  sub eax,1			; sinon on est au 5 eme

  mov dword [chifTab],eax

  cmp dword[chifTab],4
  jne Faux

  mov eax,4			;on affiche Ok si on arrive ici c'est qu'on a la valeur 4
  mov ebx,1
  mov ecx,msgOk
  mov edx,2
  int 80h
  jmp fin
 
Faux : 

  mov eax,4                     ;on affiche Faux si on arrive ici c'est que l'on a pas la valeur 4 dans chifTab
  mov ebx,1
  mov ecx,msgFaux
  mov edx,4
  int 80h
 
fin :
  mov eax,4                     ;on affiche un petit retour a la ligne puis fin
  mov ebx,1
  mov ecx,chariot
  mov edx,1
  int 80h

  mov eax,1			; fin
  mov ebx,0
  int 80h