Search   
Home  Print View  

 

Programmer's Manual

Branch Content

Instructions Set Summary

The table below summarizes the Heritage/1 instructions set. The following convention have been adopted to define mnemonics:

The 'i' suffix (as in mvi) indicates immediate addressing
The 'x' suffix (as in ldx) indicates indirect addressing.
The 'r' suffix (as in jnzr) indicates relative addressing (only used in branch instructions).
The 'm' suffix (as in incm) indicates multiple (increment/decrement multiple registers)
The 'd' suffix (as in addd) indicates direct addressing but is not always used.

No suffix indicates register addressing (as in add) except for branch instructions that indicates direct addressing (as in jp).

# REG
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
mov       r1, r2      1        5        zn--    r1=r2
mvi       r, value    2        8        zn--       r=value
ld        r, addr     2        9        zn--    r=[addr]
sto       r, addr     2        8        ----    [addr]=r
ldx       r1, r2      1        6        zn--    r1=[r2]
stox      r1, r2      1        5        ----    [r2]=r1

# STACK
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
push      r           1        5        z--v    [sp]=r, sp=sp-1
pop       r           1        6        z--v    sp=sp+1, r=[sp]

# INC/DEC
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
inc       r           1        4        zn-v    r=r+1
dec       r           1        4        zn-v    r=r-1
incm      r1, r2      1        4        zn-v    r1=r1+1, r2=r2+1
decm      r1, r2      1        4        zn-v    r1=r1-1, r2=r2-1
indec     r1, r2      1        4        zn-v      r1=r1+1, r2=r2-1
indec     implicit    1        4        zn-v      C=C-1, D=D+1, E=E+1

# ALU REG
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
add       a, r        1        5        znc-      a=a+r
sub       a, r        1        5        znc-      a=a-r
cmp       a, r        1        5        znc-      ?(a-r)
and       a, r        1        5        znc-      a=a.AND.r  
or        a, r        1        5        znc-      a=a.OR.r  
xor       a, r        1        5        znc-      a=a.XOR.r
shfl      a, r        1        5        znc-      a=(left-shifted r)
shfr      a, r        1        5        znc-      a=(right-shifted r)
swp       a, r        1        5        znc-      a=(swapped r)

# ALU IMMEDIATE
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
adi       a, value    2        8        znc-      a=a+value
subi      a, value    2        8        znc-      a=a-value
cmpi      a, value    2        8        znc-      ?(a-value)
andi      a, value    2        8        znc-      a=a.AND.value
ori       a, value    2        8        znc-    a=a.OR.value
xori      a, value    2        8        znc-      a=a.XOR.value

# ALU DIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
addd      a, addr     2        9        znc-      a=a+[addr]
subd      a, addr     2        9        znc-      a=a-[addr]
cmpd      a, addr     2        9        znc-      ?(a-[addr])
andd      a, addr     2        9        znc-      a=a.AND.[addr]  
ord       a, addr     2        9        znc-      a=a.OR.[addr]  
xord      a, addr     2        9        znc-      a=a.XOR.[addr]
shfld     a, addr     2        9        znc-      a=(left-shifted [addr])
shfrd     a, addr     2        9        znc-      a=(right-shifted [addr])
swpd      a, addr     2        9        znc-      a=(swapped [addr])

# ALU INDIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
addx      a, r        1        9        znc-      a=a+[r]
subx      a, r        1        9        znc-      a=a-[r]
cmpx      a, r        1        9        znc-      ?(a-[r])
andx      a, r        1        9        znc-      a=a.AND.[r]  
orx       a, r        1        9        znc-      a=a.OR.[r]  
xorx      a, r        1        9        znc-      a=a.XOR.[r]
shflx     a, r        1        9        znc-      a=(left-shifted [r])
shfrx     a, r        1        9        znc-      a=(right-shifted [r])
swpx      a, r        1        9        znc-      a=(swapped [r])

# JUMP DIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
jp        addr        2        8        ----      pc=addr unconditional
jz        addr        2        8        ----      pc=addr if zero
jnz       addr        2        8        ----      pc=addr if non zero
jn        addr        2        8        ----      pc=addr if negative
jnn       addr        2        8        ----      pc=addr if non negative
jc        addr        2        8        ----      pc=addr if carry
jnc       addr        2        8        ----      pc=addr if non carry
jv        addr        2        8        ----      pc=addr if overflow
jnv       addr        2        8        ----      pc=addr if non overflow

# JUMP INDIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
jpx       r           1        5        ----    pc=r  unconditional
jzx       r           1        5        ----    pc=r  if zero
jnzx      r           1        5        ----    pc=r  if non zero
jnx       r           1        5        ----    pc=r  if negative
jnnx      r           1        5        ----    pc=r  if non negative
jcx       r           1        5        ----    pc=r  if carry
jncx      r           1        5        ----    pc=r  if non carry
jvx       r           1        5        ----    pc=r  if overflow
jnvx      r           1        5        ----    pc=r  if non overflow

# JUMP RELATIVE DIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
jpr       offset      2        8        ----    pc=pc+offset  unconditional
jzr       offset      2        8        ----    pc=pc+offset  if zero
jnzr      offset      2        8        ----    pc=pc+offset  if non zero
jnr       offset      2        8        ----    pc=pc+offset  if negative
jnnr      offset      2        8        ----    pc=pc+offset  if non negative
jcr       offset      2        8        ----    pc=pc+offset  if carry
jncr      offset      2        8        ----    pc=pc+offset  if non carry
jvr       offset      2        8        ----    pc=pc+offset  if overflow
jnvr      offset      2        8        ----    pc=pc+offset  if non overflow

JUMP RELATIVE INDIRECT
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
jprx      r           1        5        ----    pc=pc+r unconditional
jzrx      r           1        5        ----    pc=pc+r if zero
jnzrx     r           1        5        ----    pc=pc+r if non zero
jnrx      r           1        5        ----    pc=pc+r if negative
jnnrx     r           1        5        ----    pc=pc+r if non negative
jcrx      r           1        5        ----    pc=pc+r if carry
jncrx     r           1        5        ----    pc=pc+r if non carry
jvrx      r           1        5        ----    pc=pc+r if overflow
jnvrx     r           1        5        ----    pc=pc+r if non overflow

# CALL AND RET
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
call      addr        2        14       ----    [sp]=f, sp=sp-1, [sp]=pc, sp=sp-1, pc=addr
callx     r           1        11       ----    [sp]=f, sp=sp-1, [sp]=pc, sp=sp-1, pc=r
callr     offset      2        14       ----    [sp]=f, sp=sp-1, [sp]=pc, sp=sp-1, pc=pc+offset
callrx    r           1        11       ----    [sp]=f, sp=sp-1, [sp]=pc, sp=sp-1, pc=pc+r

ret                   1        11       ----    sp=sp+1, pc=[sp], sp=sp+1, f=[sp]  
reti                  1        11       ----    sp=sp+1, pc=[sp], sp=sp+1, f=[sp], /SIE=0

# MISC
------------------------------------------------------------------------------------------------
mnemonic  args        words    cycles   flags   descript
------------------------------------------------------------------------------------------------
hlt                   1        4        ----    halt the machine
clrf                  1        4        zncv    clear flags
int       vector      1        11       ----    [sp]=f, sp=sp-1, [sp]=pc, sp=sp-1, pc=[vector]
ei                    1        4        ----    enable hardware interrupts
di                    1        4        ----    disable hardware interrupts
et                    1        4        ----    enable timer
dt                    1        4        ----    disable timer
------------------------------------------------------------------------------------------------


Homebuilt CPUs WebRing

JavaScript by Qirien Dhaela

Join the ring?

David Brooks, the designer of the Simplex-III homebrew computer, has founded the Homebuilt CPUs Web Ring. To join, drop David a line, mentioning your page's URL. He will then add it to the list.
You will need to copy this code fragment into your page.

Project start date: May 13 of 2009