Big Man Computer

From Esolang
Jump to navigation Jump to search

There are one thousand memory cells in each bank, each storing a decimal number from 0000 to 9999. The accumulator also stores number from 0000 to 9999 and also has a negative flag and zero flag and carry flag.

Instructions:

  • 0xxx: Halt. The xxx is irrelevant.
  • 1xxx: Add value from memory cell xxx to accumulator. Zero and negative and carry flags set according to result.
  • 2xxx: Subtract value from memory cell xxx from accumulator. Zero and negative and carry flags set according to result.
  • 3xxx: Store value of accumulator in memory cell xxx.
  • 4xxx: Branch to xxx if carry flag is clear.
  • 5xxx: Load value in memory cell xxx into accumulator. Zero flag set according to result.
  • 6xxx: Unconditional branch to xxx.
  • 7xxx: Branch to xxx if zero flag is set.
  • 8xxx: Branch to xxx if negative flag is clear.
  • 9xx0: Swap low three digits of accumulator with program counter, and swap data in bank xx with the data in the current program bank. Flags are not affected.
  • 9xx1: Read input from port xx into accumulator. Zero flag set according to result.
  • 9xx2: Output value of accumulator to port xx.
  • 9xx3: Select program bank xx. Program counter remains unchanged.
  • 9xx4: Select data bank xx.
  • 9xx5: Swap memory of bank xx with the memory of the current data bank.
  • 9xy6: Swap program bank selection with data bank selection if either digit x or y is in the accumulator.
  • 9xx7: Multiply accumulator by ten and add xx. Flags are not affected.
  • 9xx8: Divide accumulator by one hundred and shift in xx. Zero flag is set according to shifted out digits.
  • 9xy9: If x is zero, set carry flag. If y is zero, complement carry flag. If x is one, set zero flag. If y is one, complement zero flag. If x is four, set negative flag. If y is four, complement negative flag.