All pastes #447638 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-04-19 06:02 UTC
rendered paste body
DATA;
alloc varo,000999;
alloc varrr,0;
alloc numbone,0;
alloc numbtwo,0;

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;
  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;
  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
  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;
  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;
  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;
  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;
  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;
  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;
  jmp callfo;
ret

checknumb:
  cmp #eax,46;
  jne continue;
  dec eax;
  dec eax;
  cmp #eax,48;
  je insert0;
  cmp #eax,49;
  je insert1;
  cmp #eax,50;
  je insert2;
  cmp #eax,51;
  je insert3;
  cmp #eax,52;
  je insert4;
  cmp #eax,53;
  je insert5;
  cmp #eax,54;
  je insert6;
  cmp #eax,55;
  je insert7;
  cmp #eax,56;
  je insert8;
  cmp #eax,57;
  je insert9;
  cmp #eax,61;
  je insertadd;
  jmp continue;
  insert0:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,0;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert1:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,1;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert2:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,2;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert3:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,3;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert4:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,4;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert5:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,5;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert6:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,6;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert7:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,7;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert8:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,8;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insert9:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov port0,1;
  mov port1,#varrr;
  mov port2,9;
  mov port0,0;
  inc #varrr;
  jmp continue;
  insertadd:
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  inc eax;
  inc eax;
  mov #eax,0;
  sub edx,8;
  mov #varrr,0;
  mov port1,0;
  mov #numbone,port0;
  mov port1,1;
  mov #numbtwo,port0;
  add #numbone,#numbtwo;
  mov #eax,#numbone;
ret

CODE;
mov edx,0;
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;

  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 port0,#eax;
  jmp mainloop;
  backspace:
  dec eax;
  dec eax;
  dec edx;
  dec edx;
  mov #eax,0;
  jmp mainloop;