Trincot

Little Man Computer

LMC Solutions on Stack Overflow:

Other Emulators

FeatureTrincot'swww.101computing.net/LMC/peterhigginson.co.uk/lmc/
Assembler syntaxSTA + OTCSTASTA + OTC
Assembles into 3-digit numbersyesno, middle zero is omited! LDA 1 becomes 51 instead of 501. It executes correctly, but it is problematic for self modifying codeyes
Comment start characterAny non-alphanumericalnot supportedslash /
Labels case sensitivenonoyes
Rejects unresolved labelsyesno, the label name gets stored in the mailboxyes
Rejects mnemonics as labelsyesyesyes
Can use mailbox numbersyesyesyes
Rejects numerical labelsyesno, overrides mailbox numberno, ignores them
DAT range{0,...,999}any stringany decimal number
DAT parses hexadecimalnonoyes
DAT parses binarynonoyes
DAT parses scientific notationnonoyes
DAT parses label referenceyesnoyes
DAT forbids decimalsyesnono
DAT forbids non-numericalyesnoyes
DAT default value000
DAT without label definitionyesnoyes
DAT is optionalyesnono
DAT without value, with commentyesnono
INP range{0,...,999}any string{-999,...,999}
INP parses hexadecimalnono, but calculation doesyes
INP parses binarynonoyes
INP parses scientific notationnonoyes, but only loads part before E
INP parses label referencenonono
INP forbids decimalsyes, non-digit is taken as delimeternoyes, it ignores them
BRA without argument is erroryesno, execution stopsno, default mailbox is 0
INP with argument is erroryesno, is appended to opcodeno, is ignored
Accumulator after LDA{0,...,999}result of parseInt: floating point, NaN, Infinity[-999.0, 1000.0) - Hangs when reading really BIG numbers with 300 digits
Accumulator after INP{0,...,999}exact copy (string){-999,...,999}
99: LDA 0 behaviourerror on mailbox 99continues to 100 and remains in executing statecontinues to 100 and stops in fast mode, but in non-fast mode will continue to 101, 102, ... reading undefined
99: BRA 0 worksyesyesyes, but have to encode the BRA instruction inside the mailbox
Loading too large program is rejectedyesno, execution remains at PC=100yes, clipped at 98, and mailbox 99 is always 0
BRP branches whenflag is not setaccumulator is not negative and not NaNaccumulator is not negative
BRZ branches whenaccumulator is zero and flag is not setaccumulator is zeroaccumulator is zero
0xx is executed as HLTyesno, left-most digit is taken as opcodeyes
4xx is an erroryesno-opyes
999 is an erroryesno-opyes
Can run Sort programyesyesyes