Skip to content

Latest commit

 

History

History
374 lines (362 loc) · 27.6 KB

notes.org

File metadata and controls

374 lines (362 loc) · 27.6 KB

Instructions

  • LA
  • LAI
  • LAP
  • LP
  • LPI
  • LPP
  • A2P
  • ADD
  • ADDI
  • ADDP
  • SUB
  • (SUBI)
  • SUBP
  • NOR
  • NORI
  • NORP
  • SHR1
  • (SHR1I)
  • (SHR1P)
  • STA
  • (STII, store x at x)
  • STAP

Instruction encoding

Gates:

  • A clock enable
  • P clock enable
  • ALU add
  • ALU invert
  • result bus source
  • RAM store enable
  • RAM address source
  • operand bus source

Bits Calculate

bitif 0if 1notes
15do not storestore result bus to RAMjump if 15,14,13 = 0,0,0
14keep Pwrite result bus to Pregister clock enable
13keep Awrite result bus to Aregister clock enable
12result bus from operand bus/Aresult bus from ALU
11result bus from operand busresult bus from Aonly if 11 == 0
11ALU right shift or addALU NOR or subtractonly if 11 == 1, enable inverter
10ALU right shift or NORALU add or subtractenable adder
9operand bus from RAM dataoperand bus from operandimmediate
8RAM address from operandRAM address from Pshared with jumps
7-0operand
15-13note
000jump
001write A
010write P
011write A and P
100store
101write A and store
110write P and store
111write A and P, and store
12-10note
000op. bus
001op. bus (avoid, clobbers carry)
010A
011A (avoid, clobbers carry)
100right shift
101add
110nor
111subtract
9-8note
00direct operand
01P-indirect operand
10immediate operand
11P-indirect address, immediate operand

Bits Jump

bitif 0if 1notes
15fixed 0
14fixed 0
13fixed 0
12cond. noninvertedcond. inverted
11condition carry/zerocondition sign/odd
10condition carry/signcondition zero/odd
9unconditional jumpconditional jump
8jump target from operandjump target from Pshared with calculations
7-0operand
11-9note
000Jump if carry set
001Jump if A zero
010Jump if A negative
011Jump if A odd
100Jump if carry clear
101Jump if A not zero
110Jump if A positive
111Jump if A even

Instruction List

opcodemnemonicshort mnemonicinstructionsensible
000 000 00jmp ajmp aJump to ax
000 000 01jp xjpJump to Px
000 000 10jc ajc aJump to a if carry setx
000 000 11jcp xJump to P if carry setx
000 001 00
000 001 01
000 001 10jz ajz aJump to a if A = 0x
000 001 11jzp xJump to P if A = 0x
000 010 00jmp aJump to a
000 010 01jp xJump to P
000 010 10js ajs aJump to a if A[7] setx
000 010 11jsp xJump to P if A[7] = 1x
000 011 00
000 011 01
000 011 10jod ajnev aJump to a if A[0] = 1x
000 011 11jop xJump to P if A[0] = 1x
000 100 00
000 100 01
000 100 10jnc aJump to a if carry unsetx
000 100 11jncp xJump to P if carry unsetx
000 101 00
000 101 01
000 101 10jnz ajnz aJump to a if A != 0x
000 101 11jnzp xJump to P if A != 0x
000 110 00
000 110 01
000 110 10jns ajns aJump to a if A[7] not setx
000 110 11jnsp xJump to P if A[7] = 0x
000 111 00
000 111 01
000 111 10jnod ajev aJump to a if A[0] = 0x
000 111 11jnop xJump to P if A[0] = 0x
001 000 00ld.a ala aA = M[a]x
001 000 01ldp.a xlapA = M[P]x
001 000 10i.a ilai iA = ix
001 000 11
001 001 00
001 001 01
001 001 10
001 001 11
001 010 00a.a xnopA = A
001 010 01ap.a x
001 010 10
001 010 11
001 011 00
001 011 01
001 011 10
001 011 11
001 100 00shr.a xshrA = A >> 1, operand ignoredx
001 100 01
001 100 10
001 100 11
001 101 00add.a aadd aA = A + M[a]x
001 101 01addp.a xaddpA = A + M[P]x
001 101 10addi.a iaddi iA = A + ix
001 101 11
001 110 00nor.a anor aA = A nor M[a]x
001 110 01norp.a xnorpA = A nor M[P]x
001 110 10nori.a inori iA = A nor ix
001 110 11
001 111 00sub.a asub aA = A - M[a]x
001 111 01subp.a xsubpA = A - M[P]x
001 111 10subi.a isubi iA = A - ix
001 111 11
010 000 00ld.p alp aP = M[a]x
010 000 01ldp.p xlppP = M[P]x
010 000 10i.p ilpi iP = ix
010 000 11
010 001 00
010 001 01
010 001 10
010 001 11
010 010 00a.p xa2pP = A, operand igoredx
010 010 01ap.p x
010 010 10
010 010 11
010 011 00
010 011 01
010 011 10
010 011 11
010 100 00shr.p xP = A >> 1, operand ignoredx
010 100 01
010 100 10
010 100 11
010 101 00add.p aP = A + M[a]x
010 101 01addp.p xP = A + M[P]x
010 101 10addi.p iP = A + ix
010 101 11
010 110 00nor.p aP = A nor M[a]x
010 110 01norp.p xP = A nor M[P]x
010 110 10nori.p iP = A nor ix
010 110 11
010 111 00sub.p aP = A - M[a]x
010 111 01subp.p xP = A - M[P]x
010 111 10subi.p iP = A - ix
010 111 11
011 000 00ld.ap aA = P = M[a]x
011 000 01ldp.ap xA = P = M[P]x
011 000 10i.ap ilapi iA = P = ix
011 000 11
011 001 00
011 001 01
011 001 10
011 001 11
011 010 00a.ap x
011 010 01ap.ap x
011 010 10
011 010 11
011 011 00
011 011 01
011 011 10
011 011 11
011 100 00shr.ap xA = P = A >> 1, operand ignoredx
011 100 01
011 100 10
011 100 11
011 101 00add.ap aA = P = A + M[a]x
011 101 01addp.ap xA = P = A + M[P]x
011 101 10addi.ap iA = P = A + ix
011 101 11
011 110 00nor.ap aA = P = A nor M[a]x
011 110 01norp.ap xA = P = A nor M[P]x
011 110 10nori.ap iA = P = A nor ix
011 110 11
011 111 00sub.ap aA = P = A - M[a]x
011 111 01subp.ap xA = P = A - M[P]x
011 111 10subi.ap iA = P = A - ix
011 111 11
100 000 00cl.s aclm aM[a] = 0x
100 000 01clp.s xclmpM[P] = 0x
100 000 10i.s iM[i] = i??
100 000 11ip.s istip iM[P] = ix
100 001 00
100 001 01
100 001 10
100 001 11
100 010 00a.s asta aM[a] = Ax
100 010 01ap.s xstapM[P] = Ax
100 010 10
100 010 11
100 011 00
100 011 01
100 011 10
100 011 11
100 100 00shr.s ashrs aM[a] = A >> 1x
100 100 01shrp.s xM[P] = A >> 1x
100 100 10
100 100 11
100 101 00add0.s a
100 101 01add0p.s x
100 101 10addi.s iM[i] = A + i
100 101 11addip.s iM[P] = A + ix
100 110 00nor0.s a
100 110 01nor0p.s
100 110 10nori.s iM[i] = A nor i
100 110 11norip.s iM[P] = A nor ix
100 111 00sub0.s a
100 111 01sub0p.s x
100 111 10subi.s iM[i] = A - i
100 111 11subip.s iM[P] = A - ix
101 000 00cl.as aA = M[a] = 0x
101 000 01clp.as xA = M[P] = 0x
101 000 10i.as iA = M[i] = i
101 000 11ip.as iA = M[P] = ix
101 001 00
101 001 01
101 001 10
101 001 11
101 010 00a.as a
101 010 01ap.as xA = M[P] = Ax
101 010 10
101 010 11
101 011 00
101 011 01
101 011 10
101 011 11
101 100 00shr.as aA = M[a] = A >> 1x
101 100 01shrp.as xA = M[P] = A >> 1x
101 100 10
101 100 11
101 101 00add0.as a
101 101 01add0p.as x
101 101 10addi.as iA = M[i] = A + i
101 101 11addip.as iA = M[P] = A + ix
101 110 00nor0.as a
101 110 01nor0.as x
101 110 10nori.as iA = M[i] = A nor i
101 110 11norip.as iA = M[P] = A nor ix
101 111 00sub0.as a
101 111 01sub0p.as x
101 111 10subi.as iA = M[i] = A - i
101 111 11subip.as iA = M[P] = A - ix
110 000 00cl.ps aP = M[a] = 0x
110 000 01clp.ps xP = M[P] = 0x
110 000 10i.ps iP = M[i] = i
110 000 11ip.ps iP = M[P] = ix
110 001 00
110 001 01
110 001 10
110 001 11
110 010 00a.ps aP = M[a] = Ax
110 010 01ap.ps xP = M[P] = Ax
110 010 10
110 010 11
110 011 00
110 011 01
110 011 10
110 011 11
110 100 00shr.ps aP = M[a] = A >> 1x
110 100 01shrp.ps xP = M[P] = A >> 1x
110 100 10
110 100 11
110 101 00add0.ps a
110 101 01add0p.ps x
110 101 10addi.ps iP = M[i] = A + i
110 101 11addip.ps iP = M[P] = A + ix
110 110 00nor0.ps a
110 110 01nor0p.ps x
110 110 10nori.ps iP = M[i] = A nor i
110 110 11norip.ps iP = M[P] = A nor ix
110 111 00sub0.ps a
110 111 01sub0p.ps x
110 111 10subi.ps iP = M[i] = A - i
110 111 11subip.ps iP = M[P] = A - ix
111 000 00cl.aps aA = P = M[a] = 0x
111 000 01clp.aps xA = P = M[P] = 0x
111 000 10i.aps iA = P = M[i] = i
111 000 11ip.aps iA = P = M[P] = ix
111 001 00
111 001 01
111 001 10
111 001 11
111 010 00a.aps a
111 010 01ap.aps xA = P = M[P] = Ax
111 010 10
111 010 11
111 011 00
111 011 01
111 011 10
111 011 11
111 100 00shr.aps aA = P = M[a] = A >> 1x
111 100 01shrp.aps xA = P = M[P] = A >> 1x
111 100 10
111 100 11
111 101 00add0.aps a
111 101 01add0p.aps x
111 101 10addi.aps iA = P = M[i] = A + i
111 101 11addip.aps iA = P = M[P] = A + ix
111 110 00nor0.aps a
111 110 01nor0p.asp x
111 110 10nori.aps iA = P = M[i] = A nor i
111 110 11norip.aps iA = P = M[p] = A nor ix
111 111 00sub0.aps a
111 111 01sub0p.aps x
111 111 10subi.aps iA = P = M[i] = A - i
111 111 11subip.aps iA = P = M[P] = A - ix