All pastes #446075 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-18 08:33 UTC
rendered paste body
//------------------------------------------------------------------------------
//  Write line (30x15) ESI holds 0-terminated string; EDX holds color
//------------------------------------------------------------------------------
cWrite: //0051
    push EAX;
    A0051_WriteLoop:
      //The actual work:
      cmp #ESI,0;
      je A0051_End;
      cmp #ESI,13;
      je A0051_NewLine;
      mov EAX,#CharPos;
      mov ES:#EAX,#ESI; //Output char
      inc EAX;
      mov ES:#EAX,EDX; //Output char param
      inc EAX;
      mov #CharPos,EAX;
      inc ESI;
      //Check if we need scroll
      cmp #CharPos,1080; //Size of screen
      jl A0051_NoScroll;
        call cScrollScreen;
      A0051_NoScroll:
    jmp A0051_WriteLoop;
    A0051_NewLine:
      inc ESI;
      call cNewLine;
      jmp A0051_WriteLoop;
    A0051_End:
    mov ES:#CurPos,#CharPos;
    pop EAX;
  ret