-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathc8.decompiler.min.pack.html
1 lines (1 loc) · 2.12 KB
/
c8.decompiler.min.pack.html
1
<input onchange="with(f=new FileReader)readAsArrayBuffer(files[0]),onload=s"type=file><script>s=z=>{u=new Uint8Array(f.result);for(i=0;i<u.length;i+=2)o=u[i]<<8|u[i+1],p=o>>12,l=("00"+(o&4095).toString(16)).slice(-3),q=o&255,m=(0+q.toString(16)).slice(-2),n=o&15,N=n.toString(16),X=(o>>8&15).toString(16),Y=(o>>4&15).toString(16),a.innerHTML+=(1E3+(+i+512).toString(16)).slice(-4)+" | "+(1E3+o.toString(16)).slice(-4)+" | "+([n?"RET | return":"CLS | clear screen","JP 0x"+l+" | jump to 0x"+l,"CALL 0x"+l+" | call subprogram at 0x"+l,"SE V"+X+", 0x"+m+" | skip next if V"+X+" == 0x"+m,"SNE V"+X+", 0x"+m+" | skip next if V"+X+" != 0x"+m,"SE V"+X+", V"+Y+" | skip next if V"+X+" == V"+Y,"LD V"+X+", 0x"+m+" | set V"+X+" to 0x"+m,"ADD V"+X+", 0x"+m+" | add 0x"+m+" to V"+X,["LD V"+X+", V"+Y+" | set V"+X+" to V"+Y,"OR V"+X+", V"+Y+" | set V"+X+" to V"+X+" OR V"+Y,"AND V"+X+", V"+Y+" | set V"+X+" to V"+X+" AND V"+Y,"XOR V"+X+", V"+Y+" | set V"+X+" to V"+X+" XOR V"+Y,"ADD V"+X+", V"+Y+" | add V"+Y+" to V"+X+" (VF = carry)","SUB V"+X+", V"+Y+" | substract V"+Y+" to V"+X+" (VF = NOT borrow)","SHR V"+X+" | right shift V"+X+" (VF = shifted bit)","SUBN V"+X+", V"+Y+" | substract V"+X+" to V"+Y+" (VF = NOT borrow)",,,,,,"SHL V"+X+" | left shift V"+X+" (VF = shifted bit)"][n],"SNE V"+X+", V"+Y+" | skip next if V"+X+" != V"+Y,"LD I, 0x"+l+" | set I to 0x"+l,"JP V0, 0x"+l+" | jump to 0x"+l+" + V0","RND V"+X+", 0x"+m+" | set V"+X+" to a random number < 0x"+m,"DRW V"+X+", V"+Y+", 0x"+N+" | draw the 8*"+N+ "px sprite at @I at ["+X+":"+Y+"]",q-158?"SKNP V"+X+" | skip next if the key in V"+X+" is not pressed":"SKP V"+X+" | skip next if the key in V"+X+" is pressed",["LD DT, V"+X+" | set timer to V"+X,"LD F, V"+X+" | set I to the character at V"+X,,"LD ST, V"+X+" | set sound timer to V"+X,"LD V"+X+", [I] | load V0 to V"+X+" from @I to @I+"+X,"LD V"+X+", DT | load timer value in V"+X,,"LD [I], V"+X+" | store V0 to V"+X+" in @I to @I+"+X,"LD V"+X+", K | store key pressed in V"+X,"ADD I, V"+X+" | add V"+X+" to I (VF = I overflow)",,"LD B, V"+X+" | store V"+X+" in base 10 at I (hundreds), I+1 (dozens) and I+2"][q%19-2]][p]||"? | ?")+"\n"}</script><pre id=a>