![]() |
| ||
| zComp - ASM simulator (VB9) 1 Attachment(s) Hello, I would first like to note that I posted this on programmingforums some time ago; go there to catch up on all the progress I've made: http://www.programmingforums.org/post169607.html zComp is a program that acts somewhat like a basic computer processor, with it's own instruction set. You write a program in what is very much like a real Assembly programming language, and then load that up in zComp, where it will execute those instructions just like a real processor. Quote:
- Logical bitwise operators (and, or, xor, not) - loa (load the contents of a register, hardcoded value or ascii value of an inputted key into the accumulator) - sto (store the contents of the accumulator into a general purpose register) - cmp (compare two values and return true if equal else return false)... by extension, bne (jump to another instruction if cmp returned false) - ovr (same as cmp, but for seeing if a value is greater than another value... equivalent of bne is "bno") - lss (same as cmp, but for seeing if a value is lesser than another value... equivalent of bne is "bnl") - chr (display an ascii character, e.g. "chr #65" would print "A" onto the screen) - add (add the contents of a register or a hardcoded value onto the contents of another register) - sub (like add, but for subtraction) - mul (multiply the value in a register by a hardcoded value or the value in another register) - div (like mul, but for division) - sho (print the number stored in the accumulator, a general purpose register, or print a hardcoded value onto the screen) - mov (store a hardcoded value of the value in a given register in a target register) - jmp (jump to a new instruction dicated either by a hardcoded value, or contents of a register. Can also declare an isntruction to "jump back" to; e.g. jmp #89 #6 will jump to instruction 89, and then when you want to go back to #6, issue a "back" instruction) - nop (no operation; used for comments... e.g. "nop this is a comment" - clr (clear the contents of the screen such that the screen is blank)) - cln (clean out all registers and such (go back to the state the computer was in before running the program)) - key (await key input; used to pause the program) - rts (halt execution and exit) - slp (sleep for a given time, e.g. slp #1000 will make the program literally pause and do absolutely nothing for 1 second; can also say e.g. "slp 100" which will sleep for the time dictated by the value in register 100, or you can just say "slp" and it will sleep for the amount of time dictated by the value stored in the accumulator) - skp (like jump, but instead of jumping to an "absolute", it skips a number of instructions. E.g. if you were on instruction 2 and you said "skp #6", the program would jump to instruction 8) I'm looking at the x86 instruction set right now, for ideas on what kind of features to add next to zComp. Anyway, without further ado, here is the project. Contents of attached archive: Included in the archive: - Some sample programs (ASM I've written that will run on zComp) - Full zComp4 Wip1 source code (open up the .sln file in the VB9 IDE)... go to the bin/Debug folder and you'll find a bunch of .asm files, those are the sample programs. - zComp4 Wip1 executable (you'll need .NET 3.5); go to the bin/Release folder. - writeKeys (input a string, output the ASM instructions to print those characters, and output the instructions to a file, where you can then copy/paste them into your ASM program. Is useful because printing stuff to the screen by chr'ing each character is time consuming). writeKeys used to be a seperate program, but I've recently merged it with zComp, so to access writeKeys just run zComp and you'll see on the menu a key option to run writeKeys. The I've written license that this software falls under is included in the archive. Do read it before using this software so that you know your rights. I don't impose too many restrictions, and this software is both free and open source. I do my best to check whether everything works properly, though I am only one person and I sometimes overlook certain details. If anyone finds any bugs in this software, do let me know. Thanks .. .. Also, I've tested the bitwise operators I've added recently and I think they work properly, though I need someone else to verify for me. If anyone can verify for me, I would greatly appreciate it. |
| ||
| Re: zComp - ASM simulator (VB9) 1 Attachment(s) New WIP. Quote:
Included in attached archive: - Sample ASM programs - zComp 4 WIP 2 source code - zComp 4 WIP 3 executable - writeKeys (unchanged since last WIP) .. .. |
| ||
| Re: zComp - ASM simulator (VB9) Messing around with the bitshift operators, here are two simple example programs (they will be included in the next WIP and all later versions): mov #1 255The second one: mov #1 255Enjoy. |
| ||
| Re: zComp - ASM simulator (VB9) 1 Attachment(s) New WIP (haven't updated here in a few days): Quote:
Included in attached archive: - zComp 4 WIP 3 source code - zComp 4 WIP 3 executable (you'll need .NET 3.5) - writeKeys (same as ever) - some sample programs .. .. |
| ||
| Re: zComp - ASM simulator (VB9) 1 Attachment(s) New WIP (slight improvement over the last one): Quote:
The amound of lines that can be printed to the console window is 50... 48 filenames could be shown. So what if there were more than 48 files to display? That's where WIP 3 failed, because you'd get over-lapping, making it quite difficult to select a file. Acting rather like "ls -l | less" would if you want to list all files in the directory on a Linux command line, zComp 4 WIP 4 accounts for if there are too many files (lines) to display in one go, letting you "scroll" through them so that you can still see every file available. Included in the attached archive: - zComp 4 WIP 4 source code - zComp 4 WIP 4 executable (you'll need .NET 3.5) - writeKeys (same as ever) - Some sample programs .. .. |
| All times are GMT -4. The time now is 4:16 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC