Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LC3 assembly help (easy) Code works, it displays the 16 bit binary of the entered value, every 4 bits followed by a space. I get

LC3 assembly help (easy)

Code works, it displays the 16 bit binary of the entered value, every 4 bits followed by a space. I get a space after the last displayed output but I only want a new line.

Example: I get "0000 0000 0000 0000 //n" but I want "0000 0000 0000 0000//n"

Please write the branch I need/tell me where to put it so I only get the space between every 4 bits and not after. Will thumbs up thanks

.ORIG x3000

LD R6, Convert

LDR R1, R6, #0

AND R5, R5, #0

ADD R5, R5, #15

AND R4, R4, #0

ADD R4, R4, #4

LOOP

ADD R4, R4, #0

BRp NEXTNIBBLE

LEA R0, free ;this is where the issue is, i want the space every 4 numbers but not after the 16th/last one

PUTS

AND R4, R4, #0

ADD R4, R4, #4

ADD R5, R5, #0

BR ENDNEXTNIBBLE

NEXTNIBBLE

ADD R1, R1, #0

BRn IFSTAMT

LEA R0, stringzero

PUTS

BR ENDIFSTAMT

IFSTAMT

LEA R0, stringone

PUTS

ENDIFSTAMT

ADD R1, R1, R1

ADD R5, R5, #-1

ADD R4, R4, #-1

ENDNEXTNIBBLE

BRzp LOOP

LEA R0, newLine

PUTS

HALT

;Data

Convert_addr .FILL x3040

stringone .STRINGZ "1"

stringzero .STRINGZ "0"

free .STRINGZ " "

newLine .STRINGZ " "

.ORIG x3040

Convert .FILL xABCD

;END of PROGRAM

.END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago

Question

5. If yes, then why?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago