The first program and.asm reads the two inputs IN1 and IN2, uses the boolean operation AND and finally writes the result to OUT0.

Figure 7.1. And


It includes the init.asm file.

LD     IN1
AND    IN2
JMP    X      Resets Program Counter

The command ./ --html and.asm produces the and.html file that contains the link that starts the simulator with the program.

Similar commands can be written using the OR and XNOR commands. Inputs can be inverted using LDC, ANDC or ORC. The output can be inverted using STOC instead of STO. This way NAND, NOR and XOR can be made.

Linurs Servernest startpage