Sunteți pe pagina 1din 3

=first CLA introduction = hello i will be giving you some information and basic concept of what a cla mach

ine is . the info will be updated each time i get the time, please note that there is no official documents or information on this machine! except the book! i and a phd guy! form Queensland university!anyways ,read on and goodluck. so What is a CLA machine ? CLA,is (a single addressed computer with octal base ,featuring a 16 bit Accumula tor,a 9 bit programmer Counter, 512 memory lines(each 16 bits), a 2^4 or 16 inst ructions, 2 flags of z and n (representing Zero and Negative flag),and a 9 bit a ddress line) Code: _________________________ | Opcode | Address | |___________|_____________| 4 bit 9 bit ______________________________ | Opcode| M| I|X| Address | |________|__|__|_|___________| 0 0 0 MIX=000 each MIX bit triggers a specific addressing mode, generaly the MIX are set to 00 0 meaning we are in the immediate(direct) addressing mode, when we want to write some pointer based program, we typically use the indirect addressing mode , by setting the I bit to 1 , so MIX will becom e '010', and the other mode is index mode, utilizes bunch of its own registers, plus the universal commands, index mode is typically used as counter and that kind of program which utilizes counters ,and so on.the M bit in 'MIX' is a trigger which lets us use the number in the offset as an integer value! rather than an i ndicator to a memory location so you may ask what is the meaning of this ? i mean you would normally write lda 5 ada 6 this will load a number which was stored in memory location 5 and then add it wi th the value (number) stored in memorylocation 6 (the values could be anything! ), but when you write lda 5 ada M 6 it says that load the number which is stored in memory location 5 , and add it w ith number 6! (note that i didnt say memory location 6! its just number 6! ) you can use both IX bits together, but you can not use IX or MX together, these are the whole CLA commands (excluding the x registers commands which are u p to 4 commands) HLT one LDA STA SBA Halt the program , used to state the end of the program!. only instance is allowed( you cant use halt twice!) M Loades value from M Y Store the Accumultor value to Y Y Subtracts Accumultor value from Y

ORA Y s the result ANA Y s the result JMP Y JNG Y JZR Y CLA INC DEC ADA Y RED Y WRI Y

Ors the value of y with the value stored in accumultor and place in acumultor Ands the value of y with the value stored in accumultor and place in acumultor Jump to Y If the value stored in acumultor is negetive then jump to Y If the value stored in acumultor is zero then jump to Y Sets the accumulator to zero Increments the value stored in accumulator Decrements as above Adds the value of Y with the value of accumulator Reads users input and places it in Y Prints the value of Y

a sample code which can be executed on a CLA computer is as follows: //simple mode of addressing Code: 9. 10. 11. 12. 13. 14. 15. 17. 20. ORG RED RED LDA SBA JNG WRI JMP WRI HLT 9 5 6 5 6 17 5 20 6 //stating where to start

----------------Machine Language 1110 000 000 000 1110 000 000 000 0001 000 000 000 0100 000 000 000 1000 000 000 001 1111 000 000 000 0111 000 000 010 1111 000 000 000 0000 000 000 000

101 110 101 110 111 101 000 110 000

---------------------------------------//Symbolic mode of addressing Code: ORG 100 L1:LDA 1 ANA DEC JNG L2:LDA 1 ADA STA LDA DEC JZR STA LDA INC

Mask L3 sum sum count stop count L1

STA L1 STA L2 JMP L1 stop:WRI sum HLT sum:000 count:007 Mask:001 --------------------------//Index-Indirect mode of addressing MIX 0 1 1 == LDA IX 10 //loads a memory location which XR+10 points to and etc...(a couple of other addressing modes ) -------------------------Ok , you can consider this as just an introduction to CLA machine, there are lot s of stuff i want to tell you about this abstarct machine and its likeliness to DPD computers back in 1960's. i'll be updating this infos so stay tuned . thank you for your time Seyyed Hossein Hasan Pour Octorber 5th 2009

S-ar putea să vă placă și