Advertisement
bf17

NoRAL description

Sep 5th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. No-Register Assembly Language
  2.  
  3. General Concept
  4. An extremely minimal assembly language based on a hypothetical processor with no internal registers.
  5. All memory is external to the processor
  6. Addresses are 16 bit, stored big endian
  7. Memory is 8 bits
  8. Instructions use 0, 1, or 2 memory references
  9. m1 - first memory reference, updated with result of operation
  10. m2 - second memory reference
  11. xxx m1 m2 - 3 letter mnemonic separated with spaces
  12. Program listings are understood to be in hex
  13. It’s okay to write self-modifying code (maybe even necessary)
  14. # comment with ‘#’ as first character in a line
  15.  
  16.  
  17. Addressing Modes
  18. Implied : (brk, nop, ret)
  19. Absolute : 2 byte address, 10f0 (14 other instructions)
  20. Immediate: 1 byte, 2a: (sto)
  21.  
  22. Memory: 0000 - ffff
  23. Program Counter: 0000 - 0001 (initialized to 0200)
  24. Carry Flag: 0002
  25. Zero Flag: 0003
  26. Top of Stack 0004
  27. Stack 0005 - 00ff
  28. Display Memory: 0100 - 01ff, 32 x 8, 256 bytes
  29. Start of program memory: 0200
  30.  
  31. Instructions
  32.  
  33. Op Code Mnemonic Example Description (flags affected)
  34. 00 brk brk Halt program (none)
  35. 01 add add 110a 2f00 m1 = m1 + m2 (CZ)
  36. 02 and and dead beef m1 = m1 & m2 (Z)
  37. 03 jmp jmp 100f program counter = m1 (none)
  38. 04 jpc jpc 0600 if Carry flag = 1: PC = m1 (none)
  39. 05 jpz jpz 070e if Zero flag = 1: PC = m1 (none)
  40. 06 jsr jsr 20a0 push PC, inc Top of stack, PC = m1 (none)
  41. 07 mov mov 0616 b00b m1 = m2 (Z)
  42. 08 nop nop place holder (none)
  43. 09 not not 04ed m1 = not m1 (Z)
  44. 0a orr orr de05 de80 m1 = m1 | m2 (Z)
  45. 0b pop pop 1100 pop top of stack into m1 (none)
  46. 0c psh psh 1100 push m2 onto top of stack (none)
  47. 0d ret ret pop PC from stack (none)
  48. oe shl shl 3c07 shift bits left: C<7<6<5<4<3<2<1<0<zero (C)
  49. 0f shr shr 3c07 shift bits right: zero>7>6>5>4>3>2>1>C (C)
  50. 10 sto sto 3c07 33 store m1 with m2(immediate) (Z)
  51. 11 sub sub de05 de80 m1 = m1 - m2 (CZ)
  52. 12 inc inc 1000 m1 += 1 (CZ)
  53. 13 dec dec 1000 m1 -= 1 (CZ)
  54.  
  55.  
  56. created on iOS Pages, iPad Pro
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement