Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Alright, I fail at this.

Name: Anonymous 2007-02-24 0:19 ID:Ap4Fgg3r

For a class I'm taking, we're working with some simplified coding, to learn how the machine handles memory.  Our assignment now seems simple: Create a program that takes in three values, and outputs the highest.  Easy in any other programming language I've ever done, but we have to do it in Visible Virtual Machine (http://www.cba.uri.edu/faculty/vvm/)

So we have the commands:
ADD (Add number)
SUB (Subtract number)

BRP (Branch if positive)
BRZ (Branch if zero)
BR  (Branch)

DAT (data)
HLT (Halt, stop)
IN (Input)
LDA (Load accumulator)
OUT (Output)
STO (Store)

So, I figure, it'll have to be something like
IN
STO 97
IN
STO 98
IN
STO 99
LDA 97
SUB 98
BRP xx
LDA 97
SUB 99
BRP xx
LDA 98
SUB 99
BRP xx

So basically, it gets three numbers, subtracts the second from the first, and branches to.. Somewhere, if it's positive (Meaning the first is bigger.)  Then the same with the first and third, then second and third.  After that, I'm completely confused.

Has anyone else here done something like this, and are possibly able to help me?  I don't need the exact program, just some direction. >_>;

Name: Anonymous 2007-06-12 23:07 ID:Heaven

>>14

there is no way in fucking hell knuths posts here.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List