fork download
  1. num: .EQUATE 0
  2.  
  3. do: STRO menu, d
  4. ignore: LDBA charIn, d ;char input : cin >> letter
  5. STBA letter, d
  6. STRO value, d
  7. DECI num, d ;get number
  8.  
  9. CPBA 'A', i ;if(letter == 'A')
  10. ADDA num, i
  11. STWA num, d ;store sum
  12. DECO num, d ;output sum
  13.  
  14. BRNE checkS ;no, check 'S'
  15. STRO add, d ;print
  16. BR while
  17. checkS: CPBA 'S', i ;if(letter == 'S')
  18.  
  19. BRNE checkN ;no, check 'N'
  20. STRO subtract, d ;print
  21. BR while
  22. checkN: CPBA 'N', i ;if(letter == 'N')
  23. BRNE printQ ;no, print quit
  24. STRO negative, d ;print
  25. BR while
  26.  
  27. printQ: STRO quit, d
  28. while: CPBA 'Q', i ;(letter != 'Q')
  29. BRNE do ;yes, continue
  30. STOP
  31.  
  32. letter: .BYTE 1 ;global variable
  33. menu: .ASCII "Menu:\nA-ADD\nS-SUB\nN-NEG\nQ-QUIT\n\x00"
  34. add: .ASCII "ADD\n\x00"
  35. subtract:.ASCII "SUB\n\x00"
  36. negative:.ASCII "NEG\n\x00"
  37. quit: .ASCII "Quit\n\x00"
  38.  
  39. value: .ASCII "Enter number:\n\x00"
  40. newline: .BYTE '\n'
  41.  
  42. .END
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: ‘num’ does not name a type
 num:     .EQUATE 0
 ^~~
prog.cpp:4:43: error: found ‘:’ in nested-name-specifier, expected ‘::’
 ignore:  LDBA    charIn, d    ;char input : cin >> letter
                                           ^
prog.cpp:4:37: error: ‘input’ has not been declared
 ignore:  LDBA    charIn, d    ;char input : cin >> letter
                                     ^~~~~
prog.cpp:4:49: error: expected initializer before ‘>>’ token
 ignore:  LDBA    charIn, d    ;char input : cin >> letter
                                                 ^~
prog.cpp:7:32: error: ‘get’ does not name a type
          DECI    num, d       ;get number
                                ^~~
prog.cpp:9:32: error: expected unqualified-id before ‘if’
          CPBA    'A', i       ;if(letter == 'A')
                                ^~
prog.cpp:11:32: error: ‘store’ does not name a type
          STWA    num, d       ;store sum
                                ^~~~~
prog.cpp:12:32: error: ‘output’ does not name a type
          DECO    num, d       ;output sum
                                ^~~~~~
prog.cpp:14:32: error: ‘no’ does not name a type
          BRNE    checkS       ;no, check 'S'
                                ^~
prog.cpp:15:32: error: ‘print’ does not name a type
          STRO    add, d       ;print
                                ^~~~~
prog.cpp:17:32: error: expected unqualified-id before ‘if’
 checkS:  CPBA    'S', i       ;if(letter == 'S')
                                ^~
prog.cpp:19:32: error: ‘no’ does not name a type
          BRNE    checkN       ;no, check 'N'
                                ^~
prog.cpp:20:32: error: ‘print’ does not name a type
          STRO    subtract, d  ;print
                                ^~~~~
prog.cpp:22:32: error: expected unqualified-id before ‘if’
 checkN:  CPBA    'N', i       ;if(letter == 'N')
                                ^~
prog.cpp:23:32: error: ‘no’ does not name a type
          BRNE    printQ       ;no, print quit
                                ^~
prog.cpp:24:32: error: ‘print’ does not name a type
          STRO    negative, d  ;print
                                ^~~~~
prog.cpp:28:40: error: expected ‘)’ before ‘!=’ token
 while:   CPBA    'Q', i       ;(letter != 'Q')
                                        ^~
prog.cpp:29:32: error: ‘yes’ does not name a type
          BRNE    do           ;yes, continue
                                ^~~
prog.cpp:32:30: error: ‘global’ does not name a type
 letter:  .BYTE   1          ;global variable
                              ^~~~~~
stdout
Standard output is empty