the code that I already have to input 3 numbers by a user and then output the largest (no infinite number or flag) is:
INP STA FIRST INP STA SECOND INP STA THIRD LDA FIRST SUB SECOND BRP FGS LDA SECOND BRA NEXT FGS LDA FIRST NEXT STA BIGGERONE SUB THIRD BRP TNG LDA THIRD BRA RESULT TNG LDA BIGGERONE RESULT OUT HLT FIRST DATSECOND DATTHIRD DATBIGGERONE DAT
And yes the code that I responded with should be the main heart of it. Thank you!
What time do you think you can have this done by? I have to make print screens of it and type up the document for it as well. Please let me know the approximate time you expect to have this done by. Thank you!
2 hours will be pushing it, but I understand. Please try and get it done as soon as you can - I greatly appreciate your business and will give you excellent feedback if done by an hour and a half :) Thanks again!
and a bonus
whatever way you can get it to work is fine - like if you need to put the 901 and the 399 and all that stuff. totally doesn't matter to me as this is due in less than 2 hours
Little Man Mnemonic Instruction Codes with
Their Corresponding OP Codes
COB or HLT
Coffee break (or Halt)
Branch if zero
Branch if positive or zero
Data storage location
(the first ‘‘m’’ is silent). Once you learn to read these mnemonics, you’ll find that programs
written with mnemonics are generally easy to read. It is more common to write programs this
way. For a while, we will continue to print both the mnemonic and the code, but eventually,
we will stop printing the code. Most programs are also written with comments, which help
to clarify the code. The mnemonic instructions that we will use are shown in Figure 6.3.
DAT abbreviation is used to indicate that a particular mailbox will be used to store data.
The data may be specified in advance, for example, to use as a constant, or it may be zero if
the particular location is to be used to store the data later, during execution of the program.
The program, shown in Figure 6.4, works as follows: the first four instructions simply
input and store the two numbers. The fifth instruction, in mailbox 04, subtracts the first
LMC Program to Find Positive Difference of Two
negative; reverse order
print result and
used for data
Thank you for letting me work on that while you finish the last 1. Do you know how to make it look more like the code I sent you? It is pretty similar, but if you could make the code I sent you look the same as yours that would be good.
I just want all the codes to look the same format
Sorry that I am new on this site and don't really know how this works. Thanks!
can you tab the code I gave you so it matches the same formatting? and also - should there be a number in the mailbox number 36 on this program:
INPSTA FIRSTINP STA SECONDINPSTA THIRDTOP LDA FIRST SUB SECOND BRP SWAPFS LDA SECOND SUB THIRD BRP SWAPST BRA RESULTSWAPFS LDA FIRSTSTA TMP LDA SECOND STA FIRST LDA TMP STA SECOND BRA TOPSWAPST LDA SECOND STA TMP LDA THIRD STA SECOND LDA TMP STA THIRD BRA TOPRESULT LDA FIRST OUT LDA SECOND OUT LDA THIRD OUT HLTFIRST DATSECOND DATTHIRD DATTMP DAT
excellent, the last thing is - could you explain the 3rd program to me a little more clear. I don't see the pattern from the lmc