Questions tagged [pep8-assembly]

Questions regarding the PEP/8 CPU used for instructional purposes by the iTunes U course "Computer Systems". Not to be confused with the PEP8 Python coding standard.

Documentation on the PEP/8 architecture can be found at:

https://code.google.com/p/pep8-1/

There is an open-source (GPLv3) development environment which includes an assembler, simulator, and debugger. Binary builds for Mac, Windows, and Linux are available for download on the book's web site.

Use the debugger to single-step your code an examine registers / memory.

There's also a simpler stand-alone simulator, and a cache simulator that simulates cache hits/misses.

43 questions
1
vote
1 answer

How to write if statements in Pep9 Assembly?

How to write if statements in Pep9 Assembly? I want to write this if statement from C in Pep9 Assembly form. if ( (0 < weight) && (weight <= 1 ) ) { printf("Light Weight\n"); } else if((1 < weight) && (weight <= 3)){ printf("Medium…
Wusion
  • 25
  • 1
  • 8
1
vote
0 answers

How do I derive operands from ASCII table?

I'm a computer science student, currently taking a course on computer organization. I would just like some help in understanding how to derive character operands in Assembly. The instructions in assembly are straightforward, charo/chari, deco/deci,…
Benjik26
  • 11
  • 1
1
vote
0 answers

How to fix infinite loop within assembly language code:

So I am running and creating this program for homework where I input a couple of chars where I then compare it to 7 and keep count of how many 7s have been input until the # sign ends the program. For some reason, I somehow get stuck in this…
1
vote
1 answer

How i write this c code in pep/8?

How write this c code in pep/8 anyone help I am new to this #include using namespace std; int main(){ int number; cin>>number; if(number%2 == 0 ){ cout<<"Even\n"; } else{ cout<<"Odd\n"; } return 0 ; } and thanks in advance :)
mr g
  • 39
  • 1
  • 5
1
vote
1 answer

Translate PEP/8 assembly pseudo-ops to hexadecimal machine language

I'm reading the textbook Computer Systems 4th Edition. The question below is in the context of the Pep/8 virtual computer. In the exercises I am given this question: Convert the following assembly language pseudo-ops into hexadecimal machine…
1
vote
0 answers

how to create binary tree in pep8 OR see the assembly code of java code

Hello i have a question and i hope to find some answers i want to create a binary tree in pep8 to make some prefix arithmetic so to do 2+3 the user have to enter + 3 2 to do (3*2)-3 the user have to enter - * 3 2 3 i did …
saidmohamed11
  • 275
  • 5
  • 15
1
vote
1 answer

Why am I getting an error upon assembling?

I am trying to translate global array vector but whenever I assemble it I get an error. I am using indexed addressing and I don't understand why this is wrong. Figure 6.34 DECO vector,x ; << vector[i];ERROR: This instruction…
Brandon Tiqui
  • 1,429
  • 3
  • 17
  • 35
1
vote
1 answer

Stack-relative vs stack deferred addressing

What are the practical diffences between s and sf in the two code samples below? I understand that stack relative look like Mem[SP + OprndSpec] and deffered look like Mem[Mem[SP + OprndSpec]]. However what I don't understand is how this is…
Zzz
  • 2,927
  • 5
  • 36
  • 58
1
vote
1 answer

Deci to bin converter (Pep/8 assembler and simulator)

I have an assignment to create a program that converts deci (-32,768 through 32,767) to bin. The output must show all 16 bits. For example, if the input is 120, output should be: 0000000001111000. I can't figure out how to output 0s and 1s in…
Rndpbs
  • 47
  • 1
  • 6
0
votes
0 answers

writing a program in PEP8 assembly that converts a number to a chosen base

this is my code so far. I am really confused and im having a hard time using pep8. I need to convert a number to a chosen base. e.g. 343 to base 2 LDA 0,i LDX 0,i STRO prompt,d DECI base,d ;base = getInt(); …
adam123
  • 1
  • 1
0
votes
1 answer

Pep8 number decomposition

i'm trying to decompose a number in pep8 into thousands digit, followed by a part that represents the digit hundreds, followed by a part that represents the tens digit, and finally a part which represents the ones digit. exemple: the number 439…
0
votes
2 answers

./Pep8: error while loading shared libraries: libQtWebKit.so.4 on Ubuntu 20.04

I have to install PEP/8 on my Ubuntu 20.04 for my assembly course, but when I try to run the file: ./Pep8 I have this error: ./Pep8: error while loading shared libraries: libQtWebKit.so.4: cannot open shared object file: No such file or…
Saff.gh
  • 145
  • 1
  • 8
0
votes
0 answers

How to add read and add hexadecimal numbers using machine language in pep/9

BR main sum: .WORD 0 num1: .BLOCK 1 num2: .BLOCK 1 num3: .BLOCK 1 main: LDWA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STWA sum,d DECO sum,d STOP .END This is a machine language program written to add 3…
PeeKay
  • 167
  • 2
  • 2
  • 10
0
votes
0 answers

My machine language outputs gobblygook in pep9. What am i not getting?

D1 00 0D F1 FC 16 D1 00 0E F1 FC 16 D1 00 0F F1 FC 16 00 48 69 33 zz Im just using the example to learn. This is supposed to say "hi!" in the output. It, however, says symbols that i cant even copy and paste. Are the numbers being combined somehow?…
0
votes
0 answers

Intro Assembly Language Pep9 : How much to shift down

So I am very new to Assembly Language, my professor has been in and out of the class so we haven't had much time to really thoroughly go through the course material. So for our project we are using Pep9 and we have couple of things to do, which i am…
Arslan K
  • 13
  • 2
1
2 3