Você não pode selecionar mais de 25 tópicos
			Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
		
		
		
		
		
			
		
			
				
					
					
						
							54 linhas
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
	
	
							54 linhas
						
					
					
						
							1.1 KiB
						
					
					
				| void strcpy (destination, destination_segment, source, source_segment ); | |
|  | |
| void strcpy (destination, destination_segment, source, source_segment ) | |
| char *destination; | |
| int destination_segment; | |
| char *source; | |
| int source_segment; | |
| { | |
|     #asm | |
|     ; copy two strings | |
|     ; IN si: the first (zero terminated) string | |
|     ; IN di: the second (zero terminated) string | |
|     ; OUT SF and ZF (same semantics as cmp) | |
|      | |
|     #define DESTINATION 4[bp]; | |
|     #define DESTINATION_SEGMENT 6[bp]; | |
|     #define SOURCE 8[bp]; | |
|     #define SOURCE_SEGMENT 10[bp]; | |
|  | |
|     push bp | |
|     mov bp,sp | |
|     stringcompare: | |
|         push ax | |
|         push bx | |
|         push di | |
|         push es | |
|         push si | |
|         push ds | |
|         mov ax, DESTINATION;  | |
|         mov di, ax | |
|         mov ax, DESTINATION_SEGMENT;  | |
|         mov es, ax | |
|         mov ax, SOURCE;  | |
|         mov si, ax | |
|         mov ax, SOURCE_SEGMENT;  | |
|         mov ds, ax | |
|         mov cx, 0x050 | |
|     .loop: | |
|         movsb | |
|         cmp cx, 0x0 | |
|         je .end | |
|         dec cx | |
|         jmp .loop | |
|     .end: | |
|         pop ds | |
|         pop si | |
|         pop es | |
|         pop di | |
|         pop bx | |
|         pop ax | |
|         pop bp | |
|  | |
|     #endasm | |
| }
 | |
| 
 |