RAM

The result register RR is the only single bit memory location of the mc14500. Sometimes a result must be stored and used later. This could be achieved by wiring a physical output to an input, having outputs that can be read back or the more easy way: use RAM.

RAM needs also addresses so the init.asm will get lines to add 8 bits of RAM. It is also time to add symbols for all outputs and inputs of the simulator.

    RR     EQU 000  Pin RR is wired to input 0
IN1    EQU 001
IN2    EQU 002
IN3    EQU 003
IN4    EQU 004
IN5    EQU 005
IN6    EQU 006
IN7    EQU 007

OUT0   EQU 000
OUT1   EQU 001
OUT2   EQU 002
OUT3   EQU 003
OUT4   EQU 004
OUT5   EQU 005
OUT6   EQU 006
OUT7   EQU 007

RAM0   EQU 008
RAM1   EQU 009
RAM2   EQU 00A
RAM3   EQU 00B
RAM4   EQU 00C
RAM5   EQU 00D
RAM6   EQU 00E
RAM7   EQU 00F

ORC    RR       Set RR to 1   
IEN    RR       Enable inputs 
OEN    RR       Enable outputs

The following program xnor.asm uses RAM to implement a XNOR function programmed without using the XNOR instruction. IN1 and IN2 will control OUT0. To check if the mc14500 does the same the XNOR function is used to control OUT1.

Figure 7.2. Xnor

Xnor


INIT
LD     IN1
AND    IN2
STO    RAM0  Write Result to RAM
LDC    IN1
ANDC   IN2
OR     RAM0  Read from RAM
STO    OUT0

LD     IN1   Implement the same using the XNOR instruction
XNOR   IN2
STO    OUT1
JMP    X      Resets Program Counter

The command ./mc14500.py --html xnor.asm produces the xnor.html file that contains the link https://www.linurs.org/mc14500sim/index.html?rom=60A0B011328821425880117281C0&program=xnor&ilsb=False&iowidth=4&pcwidth=8&endian=little that starts the simulator with the program.


Linurs Servernest startpage