À±¼º¹ÎÀÇ È¨ÆäÀÌÁö ¿Í! | ||||||||||||||||||||||||
³ªÀÇ ¼Ò°³ | ||||||||||||||||||||||||
This property was reserved by superyoon I'm 14 years old, from South Korea (Republic Of Korea). | ||||||||||||||||||||||||
¾î¼Àºí¸® ¼÷Á¦ ³ 1 | ||||||||||||||||||||||||
Á¦ 6 ° 'call pr16bit'ÀÇ ¿ë¹ý°ú ¶óÀ̺귯¸®ÀÇ ÀåÁ¡À» ¼³¸íÇϽÿÀ. < call pr16bitÀÇ ¿ë¹ý > pr16bitÇÁ·Î½ÃÀú´Â MYLIB1.LIB¿¡ ÀÖ´Ù. MYLIB1.LIBÆÄÀÏÀº pr16.ASMÀÇ ¸ñÀû ÆÄÀÏÀ» Åͺ¸¾î¼Àºí·¯ÀÇ Åͺ¸¶óÀ̺귯¸®(TLIB(TUBO LIB).EXE)¸¦ ÀÌ¿ëÇÏ¿© ÀÛ¼ºÇÏ¿´´Ù. ±×·¯¹Ç·Î FACTO.ASMÀ» Á¤»óÀûÀ¸·Î ½ÇÇàÇϱâ À§Çؼ´ÂFACTO.ASMÀ» ¾î¼ÀºíÇÑ ÈÄ¿¡ (ASM FACTO)À̸¦ ¸µÅ©¸¦ ½ÃÅ°µÇ LIBÆÄÀÏÀ» ¹°À» ¶§¿¡ MYLIB1.LIBÀ» ÀÔ·ÂÇØ ÁÖ¸é µÈ´Ù. ±×·¯¸é FACTO.EXE°¡ ¸¸µé¾î ÁüÀ» ¾Ë ¼ö ÀÖ´Ù. ¸¸ÀÏ pr16bitÀÇ ÇÁ·Î½ÃÀú¸¦ ´Ù¸¥ ÇÁ·Î±×·¥¿¡¼µµ È£ÃâÇÏ°í ½Í´Ù¸é, ¸µÅ©¸¦ÇÒ ¶§¿¡ MYLIB1.LIB¸¦ ¶óÀ̺귯¸®·Î ÀÔ·ÂÇÏ¸é µÈ´Ù. * - FACTO.ASM - ;FACTO.ASM CALCULATING FACTORIAL PROGRAM 4ÀÇ °è½ÂÀ» ±¸ÇÏ´Â ÇÁ·Î±×·¥ CODE SEGMENT PUBLIC ASSUME CS:CODE, DS:DATA, SS:DATA ORG 100H EXTRN PR16BIT:NEAR ;¿ÜºÎÂüÁ¶ ÇÁ·Î½ÃÀú¸¦ ¼±¾ðÇÑ´Ù CODE ENDS ;Äڵ弼±×¸ÕÆ®ÀÇ ÀϺγ¡ DATA SEGMENT ;µ¥ÀÌŸ ¼¼±×¸ÕÆ®ÀÇ ½ÃÀÛ DATA ENDS ;µ¥ÀÌŸ ¼¼±×¸ÕÆ®ÀÇ ³¡ CODE SEGMENT PUBLIC ;ÄÚµå ¼¼±×¸ÕÆ®ÀÇ Àç½ÃÀÛ ASSUME CS:CODE, DS:DATA, SS:DATA ;½ºÅðú µ¥ÀÌŸ¸¦ µ¿ÀÏÇÑ À̸§À¸·Î PUBLIC START: ;½ÃÀÛÁÖ¼Ò¸¦ ¼³Á¤ÇÏ°í °ø¿ëÀ¸·Î µÒ START: ;½ÃÀÛÁÖ¼Ò ·¹À̺í FACTORIAL PROC NEAR ;°è½Â±¸ÇÏ´Â ÇÁ·Î½ÃÀúÀÇ ¼±¾ð MOV AX,1 ;°è½ÂÀ» ±¸ÇÏ´Â Áغñ´Ü°è MOV CX,1 ;Ä«¿îÅÍ 1ºÎÅͽÃÀÛ AGAIN: MUL CX ;°è½Â INC CX ;Ä«¿îÅÍ Áõ°¡ 4±îÁö CMP CX,4 ;Ä«¿îÅÍ·¹Áö½ºÅÍ CX¿Í 4¿Í ºñ±³ JLE AGAIN ;4º¸´Ù °°°Å³ª ÀÛÀ¸¸é AGAINÀ¸·Î ºÐ±âÇ϶ó CALL PR16BIT ;PR16BIT¸¦ ºÒ·¯¼ AXÀÇ ³»¿ëÀ» Ãâ·ÂÇ϶ó MOV AH,4CH ;Á¾·á¸¦ ÇÏ´Â µµ½ºÀÎÅÍ·´Æ®ÇÔ¼öÈ£Ãâ INT 21H ;ÀÎÅÍ·´Æ®½ÇÇà FACTORIAL ENDP ;ÇÁ·Î½ÃÀúÀÇ ³¡ RET ;ÇÁ·Î½ÃÀúÀÇ º¹±Í CODE ENDS ;Äڵ弼±×¸ÕÆ®ÀÇ ³¡ DATA SEGMENT ;¶Ç´Ù¸¥ µ¥ÀÌŸ¼¼±×¸ÕÆ® DATA ENDS ;¶Ç´Ù¸¥ µ¥ÀÌŸ¼¼±×¸ÕÆ®ÀÇ ³¡ END START ;½ÃÀÛÁÖ¼ÒºÎÅÍ ½ÃÀÛÇÑ ÄÚµåÀÇ Á¾°á * - PR16.ASM - ;PR16.ASM PUBLIC PR16BIT CODE SEGMENT PUBLIC ASSUME CS:CODE,DS:DATA,SS:DATA PUBLIC _HERE _HERE: PR16BIT proc NEAR push ax ;·¹Áö½ºÅ͸¦ ÀúÀåÇÑ´Ù push bx push cx push dx push di ; mov cx,0 ;ÀÚ¸®¼ö¸¦ 0À¸·Î ¼³Á¤ lea di,DIGIT_BUF+6 mov bx,10 ; 10À¸·Î ³ª´©¾î¾ß ÇÔ DIVALL: mov dx,0 ; ÇÇÁ¦¼ö¸¦ 0À¸·Î µÒ div bx ; AX¸¦ 10À¸·Î ³ª´® or dl,30h ; ³ª¸ÓÁö¸¦ ¾Æ½ºÅ°ÄÚµåȽÃÅ´ dec di mov [di],dl ; ¾Æ½ºÅ°ÀÚ¸®¼ö¸¦ ¼³Á¤ÇÏ¿© °ªÀ» ³ÖÀ½ inc cx ; ÀÚ¸®¼ö¸¦ Áõ°¡½ÃÅ´ or ax,ax ; ¸òÀÌ 0Àΰ¡? jnz DIVALL ; 0ÀÌ ¾Æ´Ï¸é OK. ; PRT: mov ah,2 ; ¼ýÀÚ¹®ÀÚ¸¦ Ãâ·ÂÇ϶ó mov dl,[di] ; ¹®ÀÚ¸¦ ¹öÆÛ·Î ºÎÅÍ ¾òÀ» °Í. int 21h inc di ; ´ÙÀ½ ÀÚ¸®¼ö·Î °¡¼ ¹Ýº¹ÇÔ loop PRT pop di ;·¹Áö½ºÅ͸¦ º¹¿øÇÑ´Ù. pop dx pop cx pop bx pop ax RET PR16BIT endp CODE ENDS DATA SEGMENT DIGIT_BUF db 6 dup(' ') DATA ENDS END < ¶óÀ̺귯¸®ÀÇ ÀåÁ¡ > LIB´Â ¶óÀ̺귯¸®¸¦ ±¸ÃàÇϱâ À§Çؼ ¸¸µé¾îÁø À¯Æ¿¸®Æ¼ÀÌ´Ù. ÇÁ·Î±×·¥À» ÇÏ´Ùº¸¸é ÀÚÁÖ ¾²ÀÌ´Â ¼ºê·çƾ(SUBROUTINE)ÀÌ Àֱ⠸¶·ÃÀÌ´Ù. ±×·¯ÇÑ ·çƾÀ» ÀÏÀÏÀÌ ÇÁ·Î±×·¥ ³»¿¡ ÄÚµùÀ» ÇÏ´Â °Íº¸´Ù. ¶óÀ̺귯¸® ¿¡ ÀúÀåÇؼ, ¸µÅ©¸¦ ÇÒ ¶§¿¡ À̸¦ °°ÀÌ ¸ñÀû ÆÄÀÏ¿¡ ¿¬°áÇÏ¿© »ç¿ëÇÏ´Â °ÍÀÌ ÁÁ´Ù. ¾î¼Àºí¸® ÇÁ·Î±×·¥À» ¶óÀ̺귯¸®·Î ¸¸µé±â À§Çؼ´Â ÇÁ·Î±×·¥À» µ¶¸³ÀûÀÎ ÇÁ·Î½ÃÀú·Î ¸¸µå´Â °ÍÀÌ ÁÁ´Ù. ¸¸ÀÏ ÇÁ·Î±×·¥¿¡¼ ¹®ÀÚ¿À» Ãâ·ÂÇÏ°í ³ª¼ °³Çà(ij¸®Áö ¸®ÅÏ)À» ½ÃÅ°°íÀÚ ÇÑ´Ù¸é, Ç×»ó INT 21H¿¡ ÇÔ¼ö ¹øÈ£ 9¹øÀ» ºÒ·¯¾ß ÇÑ´Ù. | ||||||||||||||||||||||||
¾î¼Àºí¸® ¼÷Á¦ ³ 2 | ||||||||||||||||||||||||
<°£´ÜÇÑ ¸ÅÅ©·Î ÇÁ·Î±×·¥> | main segment assume cs:main,ds:data mov ax,cs mov ds,ax ; putme macro arg1,arg2,arg3 mov dx,?1 mov ah,?2 int ?3 endm ; putme offset p1,09,21h putme offset p2,09,21h putme offset p3,09,21h mov ah,4ch int 21h main ends data segment p1 db '9514035$' p2 db 'yoon$' p3 db 'soung min$' data ends end
|
Favourite links
|
|
|
This page has been visited times. |