All pastes #403554 Raw Edit

Morbid

public text v1 · immutable
#403554 ·published 2007-03-20 13:37 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	resd	1

section .text

main :

  mov eax,tableau		; on met l'adresse du premier element du tableau dans eax
  
  mov ecx,0
  mov cl,[position]
  add eax,ecx			; 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 va afficher le chiffre (4 normalement)
  mov ebx,1
  mov ecx,msgOk
  mov edx,2
  int 80h
  jmp fin
 
Faux : 

  mov eax,4
  mov ebx,1
  mov ecx,msgFaux
  mov edx,4
  int 80h
 
fin :
  mov eax,4
  mov ebx,1
  mov ecx,chariot
  mov edx,1
  int 80h

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