I simply looked at your C code and wrote it in assembler. I offered some other code by a more experienced assembler programmer for comparison also. While compiler output is a good way to learn and see a conversion the goal, for me at least, is to write tighter, faster code than the compiler. Either way it's awesome to see some others interested in learning the language. I commented the code I wrote.
; assumes eax contains 'a' variable and ecx contains 'b' variable
begin: cmp eax, ecx ; compare the 2 variables
je getout ; if equal, we are done
ja higher ; if a is greater than b jump to higher
sub ecx, eax ; otherwise a<b so subtract a from b
jmp begin ; loop until equal
higher: sub eax, ecx ; subtract b from a
jmp begin ; loop
getout: ; result returned in eax