Langage d'assemblage if et else

Comment puis-je convertir cette assemblée?

donné j'ai ce menu

LEA SI, MSG1   
call PRINT_STRING    
gotoxy 0,1

LEA SI, MSG2  
call PRINT_STRING  
gotoxy 0,2

LEA SI, MSG3   
call PRINT_STRING  
gotoxy 0,3

LEA SI, MSG4  
call PRINT_STRING  
gotoxy 0,4    

LEA SI, MSG5  
call PRINT_STRING  
gotoxy 0,5

et de définir

MSG1 DB 'Choose Arithmetic Operation ' , 0  
MSG2 DB '(1) Addition ',0  
MSG3 DB '(2) Subtraction', 0  
MSG4 DB '(3) Multiplication',0  
MSG5 DB '(4) Division',0    

DEFINE_SCAN_NUM

DEFINE_PRINT_STRING

DEFINE_PRINT_NUM_UNS

et je veux insérer cette fi

if( x == 1)

puis ajouter

else if(x==2)

puis soustraire

else if(x==3)

puis, multiplier

else if(x == 4)

ensuite, divisez

donné que j'ai les fonctions de chaque opération arithmétique.

quelqu'un ? je suis nouveau à l'assemblée et je trouve if et else bizarre, au moins si je apprendre le truc, alors ce serait parfait. haha merci en passant.

  • La solution la plus simple: cmp x, 1; je add; cmp x, 2; je subtract et ainsi de suite. Où avez-vous coincé ...
InformationsquelleAutor CodeCracker | 2014-12-15