mmruzek
Experienced Member
Hi, I am in the process of building and improving a homebrew computer design that uses programmed ROMS for the Controller and ALU. The computer is called LALU, for "Lookup Arithmetic Logic Unit". The computer architecture has an 8 bit data bus, and a 16 bit address bus. The basic architecture is shown in this diagram.
The Instructions sent to the Instruction Register are a single byte. The top nibble of the byte contains the instruction, of which there are 16. The instruction for performing an ALU operation uses the lower 4 bits of the Instruction Byte to select which ALU operation to perform. The ALU operations contains simple things like addition of Registers A and B, Logic like an AND of Registers A and B, etc. The ALU also can be instructed to generate a flag (1 or 0), which appears in the LSB of the LALU output.
Here's the neat thing, I don't need to register the flag into C and then into A to be able to use it. So, for example, with my Conditional Jump Instructions I can specify a Jump and again use the lower 4 bits to tell the LALU what flag to generate, and therefore make the jump depend on that Flag. (For example, IF A>B the Flag = 1, THEN Jump). The flags I have right now are A=0, A=B, A>B, A<B, Overflow for A+B.
Well, it ocurred to me today that I can actually make any instruction conditional on the state of the flags. For example I have an instruction MAB. This instruction Moves A to B. (Contents of Register A to Register B). It would be a simple matter to reprogram my Lookup Controller to make this Instruction Conditional on the state of any flag that is available. Again by specifying the lower 4 bits to setup the LALU to generate the relevant flag.
Doing some reading it looks like this idea has around for a long time, but has not been widely used. So basically I am putting this topic out there to see if anyone has thoughts on the use of assembly language instructions which are conditional on the state of a flag. Thanks! Michael
The Instructions sent to the Instruction Register are a single byte. The top nibble of the byte contains the instruction, of which there are 16. The instruction for performing an ALU operation uses the lower 4 bits of the Instruction Byte to select which ALU operation to perform. The ALU operations contains simple things like addition of Registers A and B, Logic like an AND of Registers A and B, etc. The ALU also can be instructed to generate a flag (1 or 0), which appears in the LSB of the LALU output.
Here's the neat thing, I don't need to register the flag into C and then into A to be able to use it. So, for example, with my Conditional Jump Instructions I can specify a Jump and again use the lower 4 bits to tell the LALU what flag to generate, and therefore make the jump depend on that Flag. (For example, IF A>B the Flag = 1, THEN Jump). The flags I have right now are A=0, A=B, A>B, A<B, Overflow for A+B.
Well, it ocurred to me today that I can actually make any instruction conditional on the state of the flags. For example I have an instruction MAB. This instruction Moves A to B. (Contents of Register A to Register B). It would be a simple matter to reprogram my Lookup Controller to make this Instruction Conditional on the state of any flag that is available. Again by specifying the lower 4 bits to setup the LALU to generate the relevant flag.
Doing some reading it looks like this idea has around for a long time, but has not been widely used. So basically I am putting this topic out there to see if anyone has thoughts on the use of assembly language instructions which are conditional on the state of a flag. Thanks! Michael