(C)stachan 08.02.2024

YASP :: How to write text and number in the same line

	JMP main
text:
	STRING "Die Zahl ist: $$$"
main:
	PAUSE 60000
	MOV b2, 17    ;die Zahl
	MOV b5, b2
	MOV w30, w2
	LA w15, main
	JMP out
out:
	MOV w31, 0x10 ;Addresse der Zahl
	MOV b11, 0x30 ;Zum konvertieren in DEZ
	MOV w29, w30
	MOV w28, 10
	MOV w27, 0x0040

loop1:
	DIV w29, w28
	MUL w29, w28
	MOV w6, w30
	SUB w6, w29
	ADD w6, 0x30
	WRRAM w27, b13
	inc w27
	DIV w29, w28
	MOV w30, w29
	OR w29, w29
	JNZ loop1

	DEC w27
loop2:
	RDRAM b13, w27
	WRROM w31, b13
	INC w31
	DEC w27
	MOV w26, w27
	SUB w26, 0x0040
	JNC loop2

	MOV b12, 0
	WRROM w31, b12
	ECHO text
	JMPI w15
END