Microsoft (R) Macro Assembler Version 4.00 1/19/5 Page 1-1 = 000D cr equ 0dh = 000A Lf EQU 0ah C include io.h .LIST 0000 stack SEGMENT stack 0000 0100[ DW 100h DUP(?) ???? ] 0200 stack ENDS 0000 data SEGMENT 'data' 0000 0D 0A 45 4E 54 45 52 prompt db cr,lf,'ENTER FILE NAME : $' 20 46 49 4C 45 20 4E 41 4D 45 20 3A 20 20 20 24 0017 0014[ filename db 20 dup (?) ?? ] 002B ???? handle dw ? 002D 75 6E 61 62 6C 65 20 error_1 db 'unable to open file',cr,lf,'$' 74 6F 20 6F 70 65 6E 20 66 69 6C 65 0D 0A 24 0043 0D 0A 45 52 52 4F 52 error_2 db cr,lf,'ERROR in reading file',cr,lf, '$' 20 69 6E 20 72 65 61 64 69 6E 67 20 66 69 6C 65 0D 0A 24 005D 0D 0A 45 52 52 4F 52 error_3 db cr,lf,'ERROR closing file',cr,lf,'$' 20 63 6C 6F 73 69 6E 67 20 66 69 6C 65 0D 0A 24 0074 ?? char db ? 0075 20 70 72 6F 67 72 61 maker db ' programer: mojtaba amirzadeh ',CR,LF ,' url http:www.ifjam.com',CR,LF 6D 65 72 3A 20 6D 6F 6A 74 61 62 61 20 61 6D 69 72 7A 61 64 65 68 20 0D 0A 20 75 72 6C 20 68 74 74 70 3A 77 77 77 2E 69 66 6A 61 6D 2E 63 6F 6D 0D 0A 00AE data ends 0000 code SEGMENT 'code' ASSUME cs:code ,ds:data 0000 B8 ---- R start: mov ax,SEG data 0003 8E D8 mov ds,ax output maker 0015 B4 09 mov ah,09h 0017 BA 0000 R mov dx,offset prompt 001A CD 21 int 21h Microsoft (R) Macro Assembler Version 4.00 1/19/5 Page 1-2 001C B4 0A mov ah, 0ah 001E BA 0017 R mov dx,offset filename 0021 C6 06 0017 R 11 mov filename,17 0026 CD 21 int 21h 0028 8B DA mov bx,dx 002A A0 0018 R mov al,filename+1 002D 2A E4 sub ah,ah 002F 03 D8 add bx,ax 0031 C6 47 02 00 mov byte ptr[bx+2],0 0035 B4 02 mov ah,02h 0037 B2 0A mov dl,lf 0039 CD 21 int 21h 003B CD 21 int 21h 003D B0 00 mov al,0 003F B4 3D mov ah,3dh 0041 BA 0019 R mov dx,offset filename+2 0044 CD 21 int 21h 0046 73 0A jnc read 0048 B4 09 mov ah,09h 004A BA 002D R mov dx,offset error_1 004D CD 21 int 21h 004F EB 3A 90 jmp quit 0052 read: 0052 A3 002B R mov handle,ax 0055 8B D8 mov bx,ax 0057 B9 0001 mov cx,1 005A B4 3F loop1: mov ah,3fh 005C BA 0074 R mov dx,offset char 005F CD 21 int 21h 0061 73 0A jnc check 0063 B4 09 mov ah,09h 0065 BA 0043 R mov dx,offset error_2 0068 CD 21 int 21h 006A EB 1F 90 jmp quit 006D 3D 0000 check: cmp ax,0 0070 74 0A jz end_loop1 0072 B4 02 mov ah,02h 0074 8A 16 0074 R mov dl,char 0078 CD 21 int 21h 007A EB DE jmp loop1 007C end_loop1: 007C B4 3E mov ah,3eh 007E 8B 16 002B R mov dx, handle 0082 CD 21 int 21h 0084 73 05 jnc quit 0086 BA 005D R mov dx,offset error_3 0089 CD 21 int 21h 008B quit: inputc 0090 B0 00 mov al,0 0092 B4 4C mov ah,4ch 0094 CD 21 int 21h 0096 code ends end start Microsoft (R) Macro Assembler Version 4.00 1/19/5 Symbols-1 Macros: N a m e Lines ATOI . . . . . . . . . . . . . . 12 INPUTC . . . . . . . . . . . . . 5 INPUTS . . . . . . . . . . . . . 13 ITOA . . . . . . . . . . . . . . 15 M_ERROR . . . . . . . . . . . . 9 OUTPUT . . . . . . . . . . . . . 19 Segments and Groups: N a m e Size Align Combine Class CODE . . . . . . . . . . . . . . 0096 PARA NONE 'CODE' DATA . . . . . . . . . . . . . . 00AE PARA NONE 'DATA' STACK . . . . . . . . . . . . . 0200 PARA STACK Symbols: N a m e Type Value Attr ATOI_PROC . . . . . . . . . . . L FAR 0000 External CHAR . . . . . . . . . . . . . . L BYTE 0074 DATA CHECK . . . . . . . . . . . . . L NEAR 006D CODE CR . . . . . . . . . . . . . . . Number 000D END_LOOP1 . . . . . . . . . . . L NEAR 007C CODE ERROR_1 . . . . . . . . . . . . L BYTE 002D DATA ERROR_2 . . . . . . . . . . . . L BYTE 0043 DATA ERROR_3 . . . . . . . . . . . . L BYTE 005D DATA FILENAME . . . . . . . . . . . . L BYTE 0017 DATA Length = 0014 HANDLE . . . . . . . . . . . . . L WORD 002B DATA INC_PROC . . . . . . . . . . . . L FAR 0000 External INS_PROC . . . . . . . . . . . . L FAR 0000 External ITOA_PROC . . . . . . . . . . . L FAR 0000 External LF . . . . . . . . . . . . . . . Number 000A LOOP1 . . . . . . . . . . . . . L NEAR 005A CODE MAKER . . . . . . . . . . . . . L BYTE 0075 DATA OUT_PROC . . . . . . . . . . . . L FAR 0000 External PROMPT . . . . . . . . . . . . . L BYTE 0000 DATA QUIT . . . . . . . . . . . . . . L NEAR 008B CODE READ . . . . . . . . . . . . . . L NEAR 0052 CODE Microsoft (R) Macro Assembler Version 4.00 1/19/5 Symbols-2 START . . . . . . . . . . . . . L NEAR 0000 CODE 186 Source Lines 211 Total Lines 51 Symbols 49196 Bytes symbol space free 0 Warning Errors 0 Severe Errors