Microsoft (R) Macro Assembler Version 6.11 04/23/10 17:59:04 4.asm Page 1 - 1 include IO.ASM C C .nolist ;§ ¯à¥â § ¯¨á¨ í⮣® ä ©«  ¢ «¨á⨭£ C .list C 0000 s segment stack 0000 0080 [ db 128 dup (?) 00 ] 0080 s ends 0000 data segment 0000 45 72 72 6F 72 21 B db 'Error! You entered more than 100 symbols! You must enter again and it must be less$' 20 59 6F 75 20 65 6E 74 65 72 65 64 20 6D 6F 72 65 20 74 68 61 6E 20 31 30 30 20 73 79 6D 62 6F 6C 73 21 20 59 6F 75 20 6D 75 73 74 20 65 6E 74 65 72 20 61 67 61 69 6E 20 61 6E 64 20 69 74 20 6D 75 73 74 20 62 65 20 6C 65 73 73 24 0053 74 65 78 74 20 69 q db 'text is empty$' 73 20 65 6D 70 74 79 24 0061 0065 [ X db 101 dup (?) 00 ] 00C6 4F 6C 64 20 74 65 Src db 'Old text: $' 78 74 3A 20 24 00D1 52 75 6C 65 3A 20 Ru db 'Rule: $' 24 00D8 4E 65 77 20 74 65 New db 'New text: $' 78 74 3A 20 24 00E3 data ends 0000 com segment assume cs: com, ds: data, ss: s 0000 start: 0000 B8 ---- R mov ax,data 4.asm(16): warning A4012: line number information for segment without class 'CODE' : com 0003 8E D8 mov ds,ax ;Ââîä òåêñòà 0005 Re: outch '>' 0005 52 1 push dx 0006 50 1 push ax 0007 B2 3E 1 mov dl,'>' 0009 B4 02 1 mov ah,2 000B CD 21 1 int 21h 000D 58 1 pop ax 000E 5A 1 pop dx 000F B9 0001 mov cx, 1 0012 2B F6 sub si, si 0014 Next: inch X[si] 0014 50 1 push ax 0015 B0 00 1 mov al,0 0017 9A ---- 0000 E 1 call procinch 001C 88 84 0061 R 1 mov X[si],al 0020 58 1 pop ax 0021 80 BC 0061 R 2E cmp X[si], '.' 0026 74 1F je EI 0028 83 F9 64 cmp cx, 64h 002B 73 04 jae Ls 002D 41 inc cx 002E 46 inc si 002F EB E3 jmp Next 0031 8D 16 0000 R Ls: lea dx, B outstr 0035 50 1 push ax 0036 B4 09 1 mov ah,9 0038 CD 21 1 int 21h 003A 58 1 pop ax flush 003B 9A ---- 0000 E 1 call procflush newline 0040 9A ---- 0000 E 1 call procnl 0045 EB BE jmp Re 0047 49 EI: dec cx 0048 83 FE 00 cmp si,0 004B 75 16 jne EIp 004D 8D 16 0053 R lea dx, q outstr 0051 50 1 push ax 0052 B4 09 1 mov ah,9 0054 CD 21 1 int 21h 0056 58 1 pop ax flush 0057 9A ---- 0000 E 1 call procflush newline 005C 9A ---- 0000 E 1 call procnl 0061 EB A2 jmp Re 0063 C6 84 0061 R 24 EIp: mov X[si], '$' 0068 8D 16 00C6 R lea dx, Src outstr 006C 50 1 push ax 006D B4 09 1 mov ah,9 006F CD 21 1 int 21h 0071 58 1 pop ax 0072 8D 16 0061 R lea dx, x outstr 0076 50 1 push ax 0077 B4 09 1 mov ah,9 0079 CD 21 1 int 21h 007B 58 1 pop ax newline 007C 9A ---- 0000 E 1 call procnl 0081 8D 06 0061 R lea ax, x 0085 50 push ax 0086 E8 004A call Prove 0089 8D 16 00D1 R lea dx, Ru outstr 008D 50 1 push ax 008E B4 09 1 mov ah,9 0090 CD 21 1 int 21h 0092 58 1 pop ax newline 0093 9A ---- 0000 E 1 call procnl 0098 83 F8 01 cmp ax, 1 009B 75 0A jne LR2 009D 8D 06 0061 R lea ax, x 00A1 50 push ax 00A2 E8 006C call Rule1 00A5 EB 0F jmp End4 00A7 8D 06 0061 R LR2: lea ax, x outstr 00AB 50 1 push ax 00AC B4 09 1 mov ah,9 00AE CD 21 1 int 21h 00B0 58 1 pop ax 00B1 51 push cx 00B2 50 push ax 00B3 E8 0087 call Rule2 00B6 8D 16 00D8 R End4: lea dx, New outstr 00BA 50 1 push ax 00BB B4 09 1 mov ah,9 00BD CD 21 1 int 21h 00BF 58 1 pop ax 00C0 8D 16 0061 R lea dx, x outstr 00C4 50 1 push ax 00C5 B4 09 1 mov ah,9 00C7 CD 21 1 int 21h 00C9 58 1 pop ax newline 00CA 9A ---- 0000 E 1 call procnl finish 00CF B4 4C 1 mov ah,4Ch 00D1 CD 21 1 int 21h ;Function checks the property ;ax=1 - true. ax=2 - false 00D3 Prove proc 00D3 55 push bp 00D4 8B EC mov bp, sp 00D6 53 push bx 00D7 56 push si 00D8 2B F6 sub si, si 00DA 8B 5E 04 mov bx, [bp+4] 00DD 80 38 30 CD: cmp [bx][si], byte ptr '0' 00E0 72 24 jb N 00E2 80 38 39 cmp [bx][si], byte ptr '9' 00E5 77 00 ja p1 00E7 80 38 41 p1: cmp [bx][si], byte ptr 'A' 00EA 72 1A jb N 00EC 80 38 5A cmp [bx][si], byte ptr 'Z' 00EF 77 00 ja p2 00F1 80 38 61 p2: cmp [bx][si], byte ptr 'a' 00F4 72 10 jb N 00F6 80 38 7A cmp [bx][si], byte ptr 'z' 00F9 77 0B ja N 00FB 46 inc si 00FC 80 38 24 cmp byte ptr [bx][si], '$' 00FF 75 DC jne CD 0101 B8 0001 mov ax, 1 0104 EB 05 jmp E1 0106 B8 0002 N: mov ax, 2 0109 EB 00 jmp E1 010B 5E E1: pop si 010C 5B pop bx 010D 5D pop bp 010E C2 0004 ret 4 0111 Prove endp 0111 Rule1 proc 0111 55 push bp 0112 8B EC mov bp, sp 0114 53 push bx 0115 56 push si 0116 51 push cx 0117 2B F6 sub si, si 0119 8B 5E 04 mov bx, [bp+4] 011C 80 38 61 Next2: cmp [bx][si], byte ptr 'a' 011F 72 0F jb N2 0121 80 38 7A cmp [bx][si], byte ptr 'z' 0124 77 0A ja N2 0126 B9 0061 mov cx, 'a' 0129 29 08 sub [bx][si], cx 012B B9 0041 mov cx, 'A' 012E 01 08 add [bx][si], cx 0130 46 N2: inc si 0131 83 38 24 cmp [bx][si], '$' 0134 75 E6 jne Next2 0136 59 pop cx 0137 5E pop si 0138 5B pop bx 0139 5D pop bp 013A C2 0004 ret 4 013D Rule1 endp 013D Rule2 proc 013D 55 push bp 013E 8B EC mov bp, sp 0140 53 push bx 0141 56 push si 0142 51 push cx 0143 50 push ax 0144 52 push dx 0145 57 push di 0146 8B 7E 06 mov di, [bp+6] 0149 8B 5E 04 mov bx, [bp+4] 014C 8B C7 mov ax,di 014E 33 C9 xor cx,cx 0150 B1 02 mov cl,2 0152 F6 F1 div cl 0154 02 C4 add al,ah 0156 8A C8 mov cl,al 0158 32 ED xor ch,ch outword ax 015A 50 2 push ax 015B 52 2 push dx 015C B2 00 2 mov dl,0 015E 8B C0 2 mov ax,ax 0160 B6 00 2 mov dh,0 0162 9A ---- 0000 E 2 call procoutnum 0167 5A 2 pop dx 0168 58 2 pop ax 0169 8B F1 Next3: mov si,cx 016B 8B D7 mov dx,di 016D 2B F9 sub di,cx 016F FF 31 push [bx][di] 0171 FF 30 push [bx][si] 0173 8F 01 pop [bx][di] 0175 8F 00 pop [bx][si] 0177 8B FA mov di,dx 0179 E2 EE loop Next3 017B 5F pop di 017C 5A pop dx 017D 58 pop ax 017E 59 pop cx 017F 5E pop si 0180 5B pop bx 0181 5D pop bp 0182 C2 0006 ret 6 0185 Rule2 endp 0185 com ends end start Microsoft (R) Macro Assembler Version 6.11 04/23/10 17:59:04 4.asm Symbols 2 - 1 Macros: N a m e Type finish . . . . . . . . . . . . . Proc flush . . . . . . . . . . . . . Proc inch . . . . . . . . . . . . . . Proc inint . . . . . . . . . . . . . Proc newline . . . . . . . . . . . . Proc outch . . . . . . . . . . . . . Proc outint . . . . . . . . . . . . . Proc outnum . . . . . . . . . . . . . Proc outstr . . . . . . . . . . . . . Proc outword . . . . . . . . . . . . Proc same . . . . . . . . . . . . . . Proc Segments and Groups: N a m e Size Length Align Combine Class com . . . . . . . . . . . . . . 16 Bit 0185 Para Private data . . . . . . . . . . . . . . 16 Bit 00E3 Para Private s . . . . . . . . . . . . . . . 16 Bit 0080 Para Stack Procedures, parameters and locals: N a m e Type Value Attr Prove . . . . . . . . . . . . . P Near 00D3 com Length= 003E Private Rule1 . . . . . . . . . . . . . P Near 0111 com Length= 002C Private Rule2 . . . . . . . . . . . . . P Near 013D com Length= 0048 Private Symbols: N a m e Type Value Attr ??0000 . . . . . . . . . . . . . Number 0000h ??0001 . . . . . . . . . . . . . Number 0000h B . . . . . . . . . . . . . . . Byte 0000 data CD . . . . . . . . . . . . . . . L Near 00DD com E1 . . . . . . . . . . . . . . . L Near 010B com EIp . . . . . . . . . . . . . . L Near 0063 com EI . . . . . . . . . . . . . . . L Near 0047 com End4 . . . . . . . . . . . . . . L Near 00B6 com LR2 . . . . . . . . . . . . . . L Near 00A7 com Ls . . . . . . . . . . . . . . . L Near 0031 com N2 . . . . . . . . . . . . . . . L Near 0130 com New . . . . . . . . . . . . . . Byte 00D8 data Next2 . . . . . . . . . . . . . L Near 011C com Next3 . . . . . . . . . . . . . L Near 0169 com Next . . . . . . . . . . . . . . L Near 0014 com N . . . . . . . . . . . . . . . L Near 0106 com Re . . . . . . . . . . . . . . . L Near 0005 com Ru . . . . . . . . . . . . . . . Byte 00D1 data Src . . . . . . . . . . . . . . Byte 00C6 data X . . . . . . . . . . . . . . . Byte 0061 data p1 . . . . . . . . . . . . . . . L Near 00E7 com p2 . . . . . . . . . . . . . . . L Near 00F1 com procflush . . . . . . . . . . . L Far 0000 External procinch . . . . . . . . . . . . L Far 0000 External procinint . . . . . . . . . . . L Far 0000 External procnl . . . . . . . . . . . . . L Far 0000 External procoutnum . . . . . . . . . . . L Far 0000 External q . . . . . . . . . . . . . . . Byte 0053 data start . . . . . . . . . . . . . L Near 0000 com 1 Warnings 0 Errors