// encoding // https://codeabbey.github.io/heavy-data-1/msc-4-asm-manual-1973.pdf // only word BEFORE the colon shall be recognised, the rest shall be counted as if it where a comment // x shall count as 0 or 1 #P: 0P: r0:r1 1P: r2:r3 2P: r4:r5 3P: r6:r7 4P: r8:r9 5P: r10:r11 6P: r12:r13 7P: r14:r15 RP: 000:0P 001:1P 010:2P 011:3P 100:4P 101:5P 110:6P 111:7P REG: 0000:r0 0001:r1 0010:r2 0011:r3 0100:r4 0101:r5 0110:r6 0111:r7 1000:r8 1001:r9 1010:r10 1011:r11 1100:r12 1101:r13 1110:r14 1111:r15 xx: 00:ADD 01:SUB 10:LD 11:XCH xxxx: 0000:CLR 0001:CLC 0010:IAC 0011:CMC 0100:CMA 0101:RAL 0110:RAR 0111:TCC 1000:DAC 1001:TCS 1010:STC 1011:DAA 1100:KBP CN: //1xxx: invert all other jump conditions 0xx1: none //jump if test signal of 4004 is = 0 1xx1: none //jump if test signal of 4004 is = 1 0x1x: none //jump if carry bit = 1 1x1x: none //jump if carry bit = 0 01xx: none //jump if accumulator = 0 11xx: none //jump if accumulator != 0 OP: 0000:WRM 0001:WMP 0010:WRR 0011:WPM 0100:WR0 0101:WR1 0110:WR2 0111:WR3 1000:SBM 1001:RDM 1010:RDR 1011:ADM 1100:RD0 1101:RD1 1110:RD2 1111:RD3 /* consecutive sequence will be concated * example: * |DATA|DATA| * assuming DATA is 4 bits long * indicates DATA takes up 8 bits */ DATA: xxxx:DATA ADDR: xxxx:ADDR // | does nothing and can act as a visual seperator to help visualize the structure of an encoding's binary layout FIN: |0011|RP|0| // 0011 000 0 OR 0011 001 0 OR 0011 010 0 and so on 0011 111 0 INC: |0110|REG | |10|xx|REG| |1111|xxxx| FIM: |0010|RP|0|DATA|DATA| LDM: |1101|DATA| JUN: |0100|ADDR|ADDR|ADDR| JIN: |0011|RP|1| JCN: |0001|CN |ADDR|ADDR| ISZ: |0111|REG |ADDR|ADDR| JMS: |0101|ADDR|ADDR|ADDR| BBL: |1100|DATA| NOP: |0000|0000| DCL: |1111|1101| SRC: |0010|RP|1| |1110|OP |