All pastes #448639 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-19 19:55 UTC
rendered paste body
DATA;
alloc varo,000999;
alloc varrr,0;
alloc numbone,0;
alloc numbtwo,0;
define blinkrate,2043;
define cursize,2044;
define curenable,2046;
define curadd,2045;
alloc randvar,0;

initscreen:
  mov ES:#cursize,0.25;
  mov ES:#blinkrate,0.50;
  mov ES:#curenable,1;
ret

checkclr:
  cmp #eax,114;
  jne callthree;
  dec eax;
  dec eax;
  cmp #eax,108;
  jne callthree;
  dec eax;
  dec eax;
  cmp #eax,99;
  jne callthree;
  mov eax,67577;
  mov #eax,1;
  mov #eax,0;
  mov edx,0;
  mov ES:#curadd,edx;
  jmp callthree;
ret
checkbg:
  cmp #eax,103;
  jne calltwo;
  dec eax;
  dec eax;
  cmp #eax,98;
  jne calltwo;
  dec eax;
  dec eax;
  cmp #eax,114;
  je cred;
  cmp #eax,103;
  je cgreen;
  cmp #eax,98;
  je cblue;
  cmp #eax,100;
  je cdefault;
  jmp calltwo;

  cred:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov eax,67578;
  mov #eax,600;
  mov ES:#curadd,edx;
  jmp calltwo;
  cblue:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov eax,67578;
  mov #eax,006
  mov ES:#curadd,edx;
  jmp calltwo;
  cgreen:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov eax,67578;
  mov #eax,060;
  mov ES:#curadd,edx;
  jmp calltwo;
  cdefault:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov eax,67578;
  mov #eax,000;
  mov ES:#curadd,edx;
  jmp calltwo;
ret

checktx:
  cmp #eax,120;
  jne callfo;
  dec eax;
  dec eax;
  cmp #eax,116;
  jne callfo;
  dec eax;
  dec eax;
  cmp #eax,114;
  je ctred;
  cmp #eax,103;
  je ctgreen;
  cmp #eax,98;
  je ctblue;
  cmp #eax,100;
  je ctdefault;
  jmp callfo;

  ctred:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov #varo,000900;
  mov ES:#curadd,edx;
  jmp callfo;
  ctblue:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov #varo,000009;
  mov ES:#curadd,edx;
  jmp callfo;
  ctgreen:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov #varo,000090;
  mov ES:#curadd,edx;
  jmp callfo;
  ctdefault:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov #varo,000999;
  mov ES:#curadd,edx;
  jmp callfo;
ret

checknumb:
  cmp #eax,47;
  jne continue;
  dec eax;
  dec eax;
  cmp #eax,49;
  jne continue;
  sub eax,12;
  cmp #eax,112;
  je execute;
ret

CODE;
mov edx,0;
mov ES,65536;
call initscreen;
mainloop:
  mov eax,67584;
  cmp #eax,0;
  je mainloop;
  mov eax,67585;
  mov ecx,#eax;
  mov #eax,ecx;
  mov eax,65536;
  add eax,edx;
  cmp ecx,127;
  je backspace;
  mov #eax,ecx;
  pickup:
  inc edx;
  inc eax;
  mov #eax,#varo;
  inc edx;

  mov ES:#curadd,edx;

  dec eax;
  cmp #eax,13;
  jne continue;
  dec eax;
  dec eax;
  call checkbg;
  calltwo:
  call checkclr;
  callthree:
  call checktx;
  callfo:
  call checknumb;

  continue:
  mov eax,67585
  mov port5,#eax;
  jmp mainloop;
  backspace:
  cmp eax,65536;
  je mainloop;
  dec eax;
  dec eax;
  dec edx;
  dec edx;
  mov ES:#curadd,edx;
  mov #eax,0;
  jmp mainloop;