if statement - IF Condition on Assembly not working -


hi guy's have code, on assembly using assembler fasm (flatassembler)

;request value (1 or 2) mov ah, 3fh mov bx, 0 mov cx, 1 mov dx, valor int 21h  ;the not working if cmp [size], '2' jmp small cmp [size], '1' jmp e  ;one of labels if must jump small:         mov cx, 10         mov dx, 9 .....   ;other label e: mov ah, 07h int 21h 

the program not jump labels tryed cmp [size], 2 , subtracted 48 decimal value no luck

any help?

instead of calling jump after cmp [size],'2' should use je

cmp [size], '2' je small cmp [size], '1' je e 

the processor keeps track of last operation using flags.in case of cmp subtract first value second.then checks 0 flag find whether 2 values in case [size] , '2' equal or not.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -