I have no clue and I just want to know what it even means as this hasnt been talked in any of my classes. Can someone help me! : r/computerscience Skip to main content

Get the Reddit app

Scan this QR code to download the app now
Or check it out in the app stores
r/computerscience icon
r/computerscience icon
Go to computerscience
r/computerscience

The hot spot for CS on reddit.


Members Online

I have no clue and I just want to know what it even means as this hasnt been talked in any of my classes. Can someone help me!

Help

 The question:

Using Peter Higginson's Little Man Computer implementation with the following program:

If the user enters 23, 67, 32, 0

Blank #1: What will be the value in address 1 the first time the BRZ instruction at address 2 is reached?

Blank #2: What will be the value in the accumulator the first time the SUB instruction at address 4 is reached?

Blank #3: What will be the value in address the accumulator the first time the STA instruction at address 5 is reached?

Blank #4: What will be the value in address 1 the second time the BRZ instruction at address 2 is reached?

input   inp
here    sta 99
        brz there
        lda here
        sub one
        sta here
        bra input
there   lda 99
        brz done
        out
        lda there
        sub one
        sta there
        bra there
done    hlt
one     dat 1
Share
Thinking Snoo

Be the first to comment

Nobody's responded to this post yet.
Add your thoughts and get the conversation going.