All pastes #242627 Raw Edit

Stuff

public text v1 · immutable
·published 2006-11-07 14:31 UTC
rendered paste body
					.Model Small;64KB
					.Stack 100h;256 Bytes
					.DATA
Meldung DB "Hello World",10,13,"$" ;DB -> 1 Byte
																	 ;in C: char Meldung[]="Hello World\n";
					.CODE
Start:	
					WriteStr MACRO Str,WieOft
					 mov ax,@data			;Data Segment nach AX
					 mov ds,ax			 	;AX nach DS
					 mov dx,OFFSET Str ;Offset von Str nach dx
					 mov cx,WieOft ;Anzahl
					 call RepStr ;Prozedur RepStr aufrufen
					ENDM WriteStr ;Macro Ende
					
					WriteStr Meldung,3 ;Variable Meldung 3 mal ausgeben

					mov ah,4Ch ;Programm beenden
					int 21h 	
					
RepStr 		PROC NEAR ;Prozedur zum wiederholten ausgeben eines Strings
					push ax ;AX aufrufen
					push cx ;cx aufrufen
					mov ah,09h ;bereit machen zum ausgeben
LoopLbl:  
					int 21h ;ausgeben
					Loop LoopLbl ;wiederholen
					pop cx
					pop ax
					ret ;zurueck -> Zeile 17: mov ah,4Ch -> Programm beenden
RepStr		ENDP	;Prozedur Ende
					END Start ;Start Ende