2

I need to output binary conversions(which I understand how to do). The issue I am having is that the LMC seems to not be able to print three zeros or '000'. Any idea how to get the program to perform this behavior? If this is a terrible question please help me rephrase or point me to a resource, thank you very much.

Edit: The code I am using:

       LDA  first
       OUT
       HLT
first  DAT  001

or

       LDA  first
       OUT
       HLT
first  DAT  000

Neither worked for me until I switched assemblers.

Justin Duncan
  • 88
  • 1
  • 6

1 Answers1

1

I changed assemblers. Turns out the one I was using doesn't support 0's before decimal digits.

Initial Assembler: The LMC Editor, Assembler, and Simulator found at http://www.d.umn.edu/~gshute/cs3011/LMC.html

Changed to: LMC from Durham University found at https://community.dur.ac.uk/m.j.r.bordewich/LMC.html

Hope it is ok to post links clear like this an not href it.

Justin Duncan
  • 88
  • 1
  • 6
  • 1
    which assembler did you change to? (And which one didn't do what you wanted?) – Peter Cordes Jun 03 '18 at 17:50
  • Although one can argue that the LMC is supposed to work with 3 digits -- according to the story of the little man moving slips of paper --, it does not deal with formatting. Numbers are just that: numbers. 004 and 4 are the same numbers. – trincot Nov 24 '19 at 21:51