How do I print in decimal in LC3?How to get the ASCII value of a character?LC-3 .BLKW How it worksHow to BR with nzp=000 in LC3LC3 Programming - Printing a histogramhow to overwrite in the memory of lc3LC3 Starting Address of the FileLC3 MultiplicationHow to print multiple text lines in LC3LC3 how do I print user input to screen?Displaying 3 digits numbers to the console LC3

Arcane Tradition and Cost Efficiency: Learn spells on level-up, or learn them from scrolls/spellbooks?

Dedicated bike GPS computer over smartphone

How can Caller ID be faked?

How can I detect if I'm in a subshell?

Digital signature that is only verifiable by one specific person

Reflecting Telescope Blind Spot?

Do items with curse of vanishing disappear from shulker boxes?

Are athletes' college degrees discounted by employers and graduate school admissions?

Must a CPU have a GPU if the motherboard provides a display port (when there isn't any separate video card)?

Can an escape pod land on Earth from orbit and not be immediately detected?

Fastest path on a snakes and ladders board

Boss making me feel guilty for leaving the company at the end of my internship

Does anyone recognize these rockets, and their location?

How can this shape perfectly cover a cube?

Does WiFi affect the quality of images downloaded from the internet?

How do I say what something is made out of?

New Site Design!

Print the phrase "And she said, 'But that's his.'" using only the alphabet

My parents claim they cannot pay for my college education; what are my options?

Bullying by school - Submitted PhD thesis but not allowed to proceed to viva until change to new supervisor

Using roof rails to set up hammock

Why not make one big CPU core?

How could I create a situation in which a PC has to make a saving throw or be forced to pet a dog?

Is there a term for someone whose preferred policies are a mix of Left and Right?



How do I print in decimal in LC3?


How to get the ASCII value of a character?LC-3 .BLKW How it worksHow to BR with nzp=000 in LC3LC3 Programming - Printing a histogramhow to overwrite in the memory of lc3LC3 Starting Address of the FileLC3 MultiplicationHow to print multiple text lines in LC3LC3 how do I print user input to screen?Displaying 3 digits numbers to the console LC3






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a code that lets user input 5 numbers and they will be added up and the sum will be displayed. If the user hits ENTER the sum will be displayed and if they press q the program will halt. I am new to LC3 and I never understood how to change a value from ASCII to decimal. I don't know if the value is not being stored or if the sum operation is not right. Anyone know how to do this?



I already tried to use x0030 (48) and subtract it from the sum but it does not work.



.ORIG x3000

RESTART
AND R0, R0, #0
AND R1, R1, #0
AND R2, R2, #0
AND R3, R3, #0 ;Clear all registers
AND R4, R4, #0
AND R5, R5, #0
AND R6, R6, #0

LEA R0, MESSAGE ;Load and print first prompt message
PUTS

ADD R4, R4, #4 ;Set counter

SUM
GETC ;Get input and echo it
OUT
ADD R1, R0, #0

LD R6, QKEY
NOT R6, R6
ADD R1, R6, R0 ;Check if user pressed the letter q
BRz DONE

LD R2, ENTER
NOT R2, R2 ;Check if user pressed ENTER key
ADD R1, R2, R0
BRz FINISH

ADD R1, R0, R1 ;Store sum value in R1
LEA R0, NEXT
PUTS ;Load and print next prompt

ADD R4, R4, #-1 ;Decrement counter
BRp SUM ;Loop

GETC ;Get final input and echo it
OUT
ADD R1, R0, #0

LD R6, QKEY
NOT R6, R6
ADD R1, R6, R0 ;Check if user pressed the letter q
BRz DONE

LD R2, ENTER
NOT R2, R2 ;Check if user pressed ENTER key
ADD R1, R2, R0
BRz FINISH

FINISH
LEA R0, OUTPUT ;Load and print prompt of sum
PUTS
LD R3, NEG30
NOT R3, R3
ADD R3, R3, #1
ADD R1, R1, R0
OUT

BR RESTART ;Restart program
DONE
LEA R0, QUIT
PUTS ;Load and print quit prompt
HALT


MESSAGE .STRINGZ "n Enter Start Number (0 - 9): "
NEXT .STRINGZ "n Enter Next Number (0 - 9): "
OUTPUT .STRINGZ "n The sum of the numbers is: "
NEG30 .FILL x30
QUIT .STRINGZ "n Thank you for playing!"
QKEY .FILL x70
ENTER .FILL x09

.END









share|improve this question




























    0















    I have a code that lets user input 5 numbers and they will be added up and the sum will be displayed. If the user hits ENTER the sum will be displayed and if they press q the program will halt. I am new to LC3 and I never understood how to change a value from ASCII to decimal. I don't know if the value is not being stored or if the sum operation is not right. Anyone know how to do this?



    I already tried to use x0030 (48) and subtract it from the sum but it does not work.



    .ORIG x3000

    RESTART
    AND R0, R0, #0
    AND R1, R1, #0
    AND R2, R2, #0
    AND R3, R3, #0 ;Clear all registers
    AND R4, R4, #0
    AND R5, R5, #0
    AND R6, R6, #0

    LEA R0, MESSAGE ;Load and print first prompt message
    PUTS

    ADD R4, R4, #4 ;Set counter

    SUM
    GETC ;Get input and echo it
    OUT
    ADD R1, R0, #0

    LD R6, QKEY
    NOT R6, R6
    ADD R1, R6, R0 ;Check if user pressed the letter q
    BRz DONE

    LD R2, ENTER
    NOT R2, R2 ;Check if user pressed ENTER key
    ADD R1, R2, R0
    BRz FINISH

    ADD R1, R0, R1 ;Store sum value in R1
    LEA R0, NEXT
    PUTS ;Load and print next prompt

    ADD R4, R4, #-1 ;Decrement counter
    BRp SUM ;Loop

    GETC ;Get final input and echo it
    OUT
    ADD R1, R0, #0

    LD R6, QKEY
    NOT R6, R6
    ADD R1, R6, R0 ;Check if user pressed the letter q
    BRz DONE

    LD R2, ENTER
    NOT R2, R2 ;Check if user pressed ENTER key
    ADD R1, R2, R0
    BRz FINISH

    FINISH
    LEA R0, OUTPUT ;Load and print prompt of sum
    PUTS
    LD R3, NEG30
    NOT R3, R3
    ADD R3, R3, #1
    ADD R1, R1, R0
    OUT

    BR RESTART ;Restart program
    DONE
    LEA R0, QUIT
    PUTS ;Load and print quit prompt
    HALT


    MESSAGE .STRINGZ "n Enter Start Number (0 - 9): "
    NEXT .STRINGZ "n Enter Next Number (0 - 9): "
    OUTPUT .STRINGZ "n The sum of the numbers is: "
    NEG30 .FILL x30
    QUIT .STRINGZ "n Thank you for playing!"
    QKEY .FILL x70
    ENTER .FILL x09

    .END









    share|improve this question
























      0












      0








      0








      I have a code that lets user input 5 numbers and they will be added up and the sum will be displayed. If the user hits ENTER the sum will be displayed and if they press q the program will halt. I am new to LC3 and I never understood how to change a value from ASCII to decimal. I don't know if the value is not being stored or if the sum operation is not right. Anyone know how to do this?



      I already tried to use x0030 (48) and subtract it from the sum but it does not work.



      .ORIG x3000

      RESTART
      AND R0, R0, #0
      AND R1, R1, #0
      AND R2, R2, #0
      AND R3, R3, #0 ;Clear all registers
      AND R4, R4, #0
      AND R5, R5, #0
      AND R6, R6, #0

      LEA R0, MESSAGE ;Load and print first prompt message
      PUTS

      ADD R4, R4, #4 ;Set counter

      SUM
      GETC ;Get input and echo it
      OUT
      ADD R1, R0, #0

      LD R6, QKEY
      NOT R6, R6
      ADD R1, R6, R0 ;Check if user pressed the letter q
      BRz DONE

      LD R2, ENTER
      NOT R2, R2 ;Check if user pressed ENTER key
      ADD R1, R2, R0
      BRz FINISH

      ADD R1, R0, R1 ;Store sum value in R1
      LEA R0, NEXT
      PUTS ;Load and print next prompt

      ADD R4, R4, #-1 ;Decrement counter
      BRp SUM ;Loop

      GETC ;Get final input and echo it
      OUT
      ADD R1, R0, #0

      LD R6, QKEY
      NOT R6, R6
      ADD R1, R6, R0 ;Check if user pressed the letter q
      BRz DONE

      LD R2, ENTER
      NOT R2, R2 ;Check if user pressed ENTER key
      ADD R1, R2, R0
      BRz FINISH

      FINISH
      LEA R0, OUTPUT ;Load and print prompt of sum
      PUTS
      LD R3, NEG30
      NOT R3, R3
      ADD R3, R3, #1
      ADD R1, R1, R0
      OUT

      BR RESTART ;Restart program
      DONE
      LEA R0, QUIT
      PUTS ;Load and print quit prompt
      HALT


      MESSAGE .STRINGZ "n Enter Start Number (0 - 9): "
      NEXT .STRINGZ "n Enter Next Number (0 - 9): "
      OUTPUT .STRINGZ "n The sum of the numbers is: "
      NEG30 .FILL x30
      QUIT .STRINGZ "n Thank you for playing!"
      QKEY .FILL x70
      ENTER .FILL x09

      .END









      share|improve this question














      I have a code that lets user input 5 numbers and they will be added up and the sum will be displayed. If the user hits ENTER the sum will be displayed and if they press q the program will halt. I am new to LC3 and I never understood how to change a value from ASCII to decimal. I don't know if the value is not being stored or if the sum operation is not right. Anyone know how to do this?



      I already tried to use x0030 (48) and subtract it from the sum but it does not work.



      .ORIG x3000

      RESTART
      AND R0, R0, #0
      AND R1, R1, #0
      AND R2, R2, #0
      AND R3, R3, #0 ;Clear all registers
      AND R4, R4, #0
      AND R5, R5, #0
      AND R6, R6, #0

      LEA R0, MESSAGE ;Load and print first prompt message
      PUTS

      ADD R4, R4, #4 ;Set counter

      SUM
      GETC ;Get input and echo it
      OUT
      ADD R1, R0, #0

      LD R6, QKEY
      NOT R6, R6
      ADD R1, R6, R0 ;Check if user pressed the letter q
      BRz DONE

      LD R2, ENTER
      NOT R2, R2 ;Check if user pressed ENTER key
      ADD R1, R2, R0
      BRz FINISH

      ADD R1, R0, R1 ;Store sum value in R1
      LEA R0, NEXT
      PUTS ;Load and print next prompt

      ADD R4, R4, #-1 ;Decrement counter
      BRp SUM ;Loop

      GETC ;Get final input and echo it
      OUT
      ADD R1, R0, #0

      LD R6, QKEY
      NOT R6, R6
      ADD R1, R6, R0 ;Check if user pressed the letter q
      BRz DONE

      LD R2, ENTER
      NOT R2, R2 ;Check if user pressed ENTER key
      ADD R1, R2, R0
      BRz FINISH

      FINISH
      LEA R0, OUTPUT ;Load and print prompt of sum
      PUTS
      LD R3, NEG30
      NOT R3, R3
      ADD R3, R3, #1
      ADD R1, R1, R0
      OUT

      BR RESTART ;Restart program
      DONE
      LEA R0, QUIT
      PUTS ;Load and print quit prompt
      HALT


      MESSAGE .STRINGZ "n Enter Start Number (0 - 9): "
      NEXT .STRINGZ "n Enter Next Number (0 - 9): "
      OUTPUT .STRINGZ "n The sum of the numbers is: "
      NEG30 .FILL x30
      QUIT .STRINGZ "n Thank you for playing!"
      QKEY .FILL x70
      ENTER .FILL x09

      .END






      ascii lc3






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 2:48









      Luis MLuis M

      11




      11






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330661%2fhow-do-i-print-in-decimal-in-lc3%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330661%2fhow-do-i-print-in-decimal-in-lc3%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현