All pastes #447650 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-19 06:26 UTC
rendered paste body
//port0 - Color in format 000999
DATA;
message:
 db ' Accepted',0;
test:
 db 2,0
alloc addme,0;
FIXPORT0:
mov #addme,0;
  bWriteLoop:
    cmp #ecx,0; //Terminate on char 0
    je bEnd;
	add #ecx,48;
	mov #ebx,#ecx;
	inc ebx;
	inc ecx;
	inc #addme;
	  jmp bWriteLoop;
  bEnd:
 sub ebx,#addme;
ret
WRITESTRING:
  AWriteLoop:
    cmp #ebx,0; //Terminate on char 0
    je AEnd;
    mov #eax,#ebx; //Output char
    inc eax;
    mov #eax,999; //Output char param
    inc eax;
    inc ebx;
	  jmp AWriteLoop;
  AEnd:
	ret
CODE;
  looop:
  mov eax,65536;
  mov ecx,test;
  CALL FIXPORT0;
  CALL WRITESTRING;
  mov ebx,message;
  CALL WRITESTRING;
  jmp looop;