ScratchAssembly the language of the scratchin' machines ________________________________ ________________________________ simulation project i guess __________________________________ the loaded program finds the solution of x^2+6x-72 and prints it on screen(the hardest part is the printing - it took hundreds of lines) to change equation change the first 3 numbers in ram to put in a,b,c (the coeficients ax^2 +bx+c) sorry for to much zeros... assembly is real hard. ____________________ the comands: ______________________ ld(reg) (adress) - load ram at adress into reg st(reg) (adress)- store register into ram at adress +(reg) (reg) - add reg to reg -(reg) (reg) - substract reg from reg *(reg) (reg) - mutliply reg by reg /(reg) (reg) - divide reg by reg \(reg) - find square root of reg ā(reg) - floor of reg jmp (adress) - jump to adress in program jmpif(reg) (adress) - jump to adress if reg is greater than 0(reg>0) addr (id) - define address to jump to(must be a single character) dr(reg) (reg) - draw to VRAM at address(reg) the value (reg)(note: it must be a single character) cv - clear VRAM io(reg) - poll input device(the key) represented by the id (reg) halt - stop the project,prevent running uselessly forever
// to drop a comment. ignored at runtime. must be on its own line, with the 2 // as the first 2 chars of the line regs(now you can add additional registers!(in the reset regs... block)): a-accumulator. when doing math, the result is stored here x-the reg on which math is performed y-the other reg on which math is performed p-instruction pointer