+
1 5 5

:

  1. #1
    Echolot       Echolot
    07.01.2007
    nsk-ats3510
    177
    ()
    0
    : 0 (: 0).

    - ? , - ( ..).. ( )... ?))

    :
    C :
    
    #include <stdio.h>
    #include <conio.h>
    
    extern int func(char *str1, char *str2, int n);
    
    main()
     ....
    	char string1[10], string2[10];
    	int n, raz;
    
    	printf ("\n Vvedite pervyu stroky...\n");
    	gets(string1);
    
    	printf ("\n Vvedite vtoryu stroky...\n");
    	gets(string2);
    
    	printf ("\n Vvedite chislo ot 1 do 10!!!\n");
    	scanf("%d", &n);
    
    	getch();
    
    	raz=func(string1, string2, n);
    	printf("\n Raznost` strok ravna: %d", raz);
    
    	getch();
     }
    
    _asm
     ....
    .model small, c
    func proc near uses si di, str1: word, str2: word, n: word
    	local LEN1: word, LEN2: word
    
    ; 1)
    mov si, str1
    mov di, str2                    
    	
    xor bx,bx                ; bx    
    
    lenstr1:		       ;   
    	inc bx		
    	inc si					 
    	cmp [si], byte ptr 0    ;   
    	jl lenstr1		
            mov LEN1,bx 
    	
       xor cx,cx          ; cx    
            
    lenstr2:			  ;   
    	inc cx					
    	inc di		
    	cmp [di], byte ptr 0   ;   
            jl lenstr2						
            mov LEN2,cx     ;  dx  2- 
    
    
    
    ; 2)
    cld
    lea si, str1
    lea di, [si+LEN1-1]
    mov cx, LEN1
    PERASTANOVKA:
    movsb
    inc si
    dec di
    dec di
    jnz PERASTANOVKA
    ;mov [di+LEN1], 0 
    
    
    ; 3)
    mov si, str2
    mov cx, n
    INSERTSPACE:
    	mov byte ptr[si], 20h
    	inc si
    	loop INSERTSPACE
    
    ; 4)
    sub LEN2, LEN1
    mov ax, LEN2
    
    ret
    func endp
    end
    }
    Echolot; 15.11.2007 23:26.

  2. #2
    BuXTeR       BuXTeR
    14.02.2007
    133
    ()
    0
    : 0 (: 0).

    :
    _asm{
           //  
        }

  3. #3
    Echolot       Echolot
    07.01.2007
    nsk-ats3510
    177
    ()
    0
    : 0 (: 0).

    : undefined symbol model...

  4. #4
    BuXTeR       BuXTeR
    14.02.2007
    133
    ()
    0
    : 0 (: 0).

    Echolot, , . MSDN:
    :
    __asm{
       mov al, 2
       mov dx, 0xD007
       out dx, al
    }

  5. #5
    Echolot       Echolot
    07.01.2007
    nsk-ats3510
    177
    ()
    0
    : 0 (: 0).

    , ))