과제 1
.386
.MODEL FLAT
ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD
INCLUDE io.h
cr EQU 0dh
Lf EQU 0ah
.STACK 4096
.DATA
Prompt1 BYTE CR, LF, "This program will convert a Celsius "
BYTE "temperature to the Fahrenheit scale", cr, Lf, Lf
BYTE "Enter Celsius temperature : ", 0
Value BYTE 10 DUP ( ? )
Answer BYTE cr, Lf, "The temperature is"
Temperature BYTE 6 DUP ( ? )
BYTE " Fahrenheit", cr, Lf, 0
.CODE
_start:
Prompt:
output Prompt1
input Value, 10
atoi Value
imul ax, 9
add ax, 2
mov bx, 5
;cwd
idiv bx
add ax, 32
itoa Temperature, ax
output Answer
INVOKE ExitProcess, 0
PUBLIC _start
END
과제 2
.386
.MODEL FLAT
ExitProcess PROTO NEAR32 stdcall, dxExitCode:DWORD
INCLUDE io.h
cr EQU 0dh
Lf EQU 0ah
.STACK 4096
.DATA
Prompt1 BYTE "Please enter Fahrenheit temperature to change in Celsius. : ", 0
Prompt2 BYTE cr, Lf, "The value "
Fahrenheit BYTE 6 DUP (?)
Prompt3 BYTE " Fahrenheit is "
Celsius BYTE 6 DUP (?)
BYTE " Celsius.", cr, Lf, 0
.CODE
_start:
output Prompt1
input Fahrenheit, 10
atoi Fahrenheit ; ax
sub ax, 32 ; ax = ax - 32
mov bx, ax ; bx = ax
mov cx, ax ; cx = ax
mov ax, 5 ; ax = 5
cwd
imul ax, cx
cwd
mov cx, 9
idiv cx
itoa Celsius, ax
output Prompt2
output Prompt3
INVOKE ExitProcess, 0
PUBLIC _start
END
'코스웨어 > 13년 스마트컨트롤러' 카테고리의 다른 글
Group 파일 분석 [문남경] (0) | 2013.09.04 |
---|---|
ASSEMBLY - jmp 명령어, group 파일 분석 - 전영기 (0) | 2013.09.04 |
group 파일 분석 (0) | 2013.09.03 |
UNIX 숙제 -/etc/group -0903 -임기준 (0) | 2013.09.03 |
어셈블리 복습 (실수는 어떻게 계산 되는가?) (1) | 2013.09.02 |
어셈블리어 과제_ 진종영 (0) | 2013.09.02 |
2013.09.02_사용권한설정 및 shadow 필드_깨알설명_김성엽 (0) | 2013.09.02 |
2013.09.02_4장어셈블리과제_김성엽 (0) | 2013.09.02 |