music
OSdata.com: programming text book 

OSdata.com

processor emulator manual
introduction

summary

    This is the introduction to the manual for the assembly language emulator.

    To paraphrase an increasingly common statement, this source code emulator is intended so that a poor person in India, China, Africa, Compton, or any other place in the world can have the same access to information and education as the rich White Anglo-Saxon Protestant male in Pasadena, Cambridge, Oxford, New Haven, Palo Alto, or any other famous college town.

    Permission is granted for use of this open source by non-profit and government schools and individuals.

    Follow the instructions for installing your own copy of the emulator or the instructions for signing in provided by those who have installed a copy for your use (such as a school).

    I am still building the emulator, but it now has enough material to be useful for some simple purposes.

    You will notice that I am implementing the 8080/8085/Z80 processor and instruction set first. This is a very simple early 8-bit processor and therefore easier to finish. But the principles apply to all other more complex processors and instruction sets, so this is a great proof of concept.

    There is a set of generic registers that includes a cross section of registers from several different processors, past and present.

    You can change the values of any register by using the command change register_name new_value. All values are supposed to be in hexadecimal, although I have not implemented validity checking yet.

    For the moment you have a dual core generic processor. I plan to give you control over the number of cores or processors and give the ability to change the processor type. I plan on allowing heterogeneous processor sets. I invite manufacturers to provide programmer reference manuals and other books necessary to accurately emulate their processors, current and past. Contact: Milo, PO Box 5237, Balboa Island, California, 92662, USA.

    I do intend to eventually add the capability for everyone to design and specify their own imaginative processors and run them in this source code emulator.

    I am in the process of adding instructions from both specific real world processors and general generic instructions that transcend any specific processor. There is an unfortunate delay between my adding the new instructions and documenting them. You can bypass the documentation by examining the free open source code, which I am updating quickly) sometimes more than once a day).

    The emulator now has the MOVE instruction, which will move the contents of a source register to a destination register. For now, the only addressing mode implemented is register direct.

    At the moment all instructions are immediately performed as they are interpretted. Program storage has not yet been implemented, making branching (and therefore decisions and loops) unavailable.

    I do intend to implement a separate program memory. This is consistent with the philosophy (if not the actual implementation) of many modern processors and makes it easy to have a generic processor without any actual machine op codes.

    Data memory is implemented as an associative array on the assumption that almost all beginner and student assembly language programs will make use of very little actual memory. If there is a real need for large sections of memory, please convert from an associative array to something like a file or data base. That conversion should be well within the prorgamming capabilities of anyone who needs it.

  1. processors
  2. entry line

manual table of contents
emulator

Google

processor emulator manual
introduction

summary

    This is the introduction to the manual for the assembly language emulator.

    This emulator needs to be installed on your own computer or server. If you are a student at a school, the school may already have it installed on the school’s servers.

    This emulator is intended for the LAMP model: Linux, Apache, MySQL, and PHP/Perl/Python.

source code emulator

    This is a source code emulator.

    One of the big problems in learning assembly language is the fact that input and output are fairly sophisticated programming tasks. Special I/O libraries or macors for beginners are the traditional solution.

    An emulator has the great advantage that there is an external control of the emulated processor. This can eliminate the need for special I/O routines because the student can directly examine and modify the registers, memory, and other portions of the emulated processor.

current status

    The CHANGE command can be used to assign any value to any register. Note there is no validity checking yet, so you can assign ridiculous values that may break the emulator.

    The CHANGE command can be used to change which processor (p0 or p1) is being used. At the moment, you can alternate between processors. The ability to run them in parallel will be added later.

    Either the ASSEMBLE or COMPILE commands will start storing processor instructions into program memory. For now these two commands have the exact same effect, although this will probably change in the future. This mode can be identified by a > prompt. Commands (as contrasted with assembly language instructions) will be implemented immediately.

    Either the ACTION or IMMEDIATE commands will cause both commands and assembly language instructions to be interpretted and acted upon immediately. For now these two commands have the exact same effect, although this may change in the future. This mode can be identified by a ! prompt.

    The MOVE can be used to move (copy) any register to any other register. At the moment only register direct addressing mode works.

    You will notice that I am implementing the 8080/8085/Z80 processor and instruction set. This is a very simple early 8-bit processor and therefore easier to finish. But the principles apply to all other more complex processors and instruction sets, so this is a great proof of concept.

    The 8080/8085/Z80 MOVMx instructions work, moving one byte from an 8080/8085/Z80 register to memory.

    The 8080/8085/Z80 MOVxx (register to register) instructions work, moving one byte from an 8080/8085/Z80 register to another register. These are byte only operations.

    The 8080/8085/Z80 CMA (compliment A register) instruction works. This is the first step towards the bit logical operations. This works on only the low order byte.

    The COMPILE command barely works. You can now store programs in a special program code memory. There are absurd restrictions because the emulator is in an early state of development (documented on the compile page).

customization

    The default copy of the source code assumes that all information is passed back and forth to the browser through HTML form data. Obviously schools will want to use a more sophisticated method to keep track of sets of data from multiple students, including the ability to save work between browser sessions.

    The SUBMIT command is currently blank (other than a message indicating it has been correctly entered) because each school will have their own methods for submitting student assignments.

    Schools that want to openly share the customization methods they have created should send a hard copy to: Milo, PO Box 5237, Balboa Island, CA, 92662, USA (I am currently homeless and don’t have reliable access to modern conveniences such as telephones or e-mail).

processor readouts

    The top left columns of the emulator report the state of the two emulated processors.

report area

    The top right area has reports on the activity of the emulator

results line

    The top of the two lines across the bottom of the emulator reports the results of erach input line.

input line

    The bottom line is for user input. Type your input and then click on the assembly language emulator button.

input format

    Inputs may be commands, directives, or instructions.

    Commands are given to the emulator. Commands may have optional parameters.

    Directives are given to the assembler. Directives may have optional parameters.

    Instructions are the actual assembly language instructions for the emulated processor. Instructions may have optional parameters.

    Comments are for the programmer’s convenience and serve the same purpose as comments in any programming language. Comments are indicated by a semicolon and continue until the end of the line.

immediate

    At the moment, all instructions take effect immediately. This obviously won’t allow for forward references. An assembly mode will be added soon.

  1. processors
  2. entry line

manual table of contents
emulator

contact

    If you find this interesting and want to contact me, write to Milo, PO Box 5237, Balboa Island, California, 92662, USA.

if you want to make a tax-deductible donation to the StarTree107 Foundation to support this educational work, contact Dr. Barry at 949-675-5778

`

    Challenge: Homeless or Facebook


return to table of contents
free downloadable college text book

previous page next page
previous page next page
Google


Made with Macintosh

    This web site handcrafted on Macintosh computers using Tom Bender’s Tex-Edit Plus and served using FreeBSD .

Viewable With Any Browser


    †UNIX used as a generic term unless specifically used as a trademark (such as in the phrase “UNIX certified”). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.

    Names and logos of various OSs are trademarks of their respective owners.

    Copyright © 2011 Milo

    Created: April 26, 2011

    Last Updated: May 31, 2011


return to table of contents
free downloadable college text book

previous page next page
previous page next page