프로그래밍 언어/Assembly
어셈블리 - 16진수를 10진수로 변환하기
리그캣
2018. 1. 22. 15:37
16진수를 10진수로 변환하기
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | TITLE HexTODec INCLUDE Irvine32.inc .DATA str1 BYTE "Input Hex:",0 str2 BYTE "output Dec:",0 str3 BYTE "Continue?(y/n):",0 str4 BYTE "Error",0 key DWORD ?,0 .CODE main PROC op: mov edx,OFFSET str1 call writestring mov eax,0 call readhex push eax call crlf mov edx,OFFSET str2 call writestring pop eax call writedec call crlf op3: mov edx,OFFSET str3 call writestring mov eax,0 call readchar call writechar mov key,eax .if key=='y' call crlf jmp op .elseif key=='n' call crlf jmp op2 .elseif call crlf mov edx,OFFSET str4 call writestring call crlf jmp op3 .endif op2: exit main ENDP END main 4+32+768+8192 | cs |