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
0
votes
0 answers

Pep/8 Assembly - Switch statement inside of loop

I am trying to convert the following C++ code into Pep/8 Assembly but it doesn't seem to work, and I really do not know whether it's because of my addressing modes or if there's a larger problem. Here is an example which utilizes a switch…
Kenneth
  • 19
  • 7
0
votes
1 answer

Pep/8 Assembly - Storing a character inside a variable without input

How would one go about doing this? I tried doing LDX first,i LDA bill,x STA 'B',i but that doesn't work. We've never gone over any problems which assign a character to a variable without inputting it like that. BR main first: …
Kenneth
  • 19
  • 7
0
votes
1 answer

Translating C++ to Pep/8 Assembly Language-- Char Array

As the title states, I am currently having issues translating a C++ program to PEP/8. The first part of the program deals with input and output of a char array. The strInput function simply reads in character values into an array until the user hits…
Chukaluk
  • 11
  • 1
0
votes
1 answer

How to change sign of a .BLOCK or .WORD in Pep8 (Assembly)?

How would I go about changing the sign of a negative .BLOCK to positive in Pep8? And the other way around? Thank you
user2994884
  • 153
  • 7
0
votes
1 answer

Complex if statements in assembly language (Pep 8)

I am working on a project in Pep8 and this is the given pseudo-code for one block of code: If ((Num2 is negative AND Result is negative) OR (Num2 is negative and Result is positive)) Change the sign of Result I'm not sure how to write translate…
user2994884
  • 153
  • 7
0
votes
1 answer

Why is Pascal's Triangle manifesting itself in the output of my array (not intended)?

I am having a problem getting my Pep/8 assembly program to produce the correct output. The goal is to input a number n followed by n numbers and then have the output place the first number at the end of the array. An example of input and correct…
Brandon Tiqui
  • 1,429
  • 3
  • 17
  • 35
0
votes
1 answer

How to use CHARI in PEP/8 to go one number to another

I have to write a program that will calculate the average of several numbers in/with Pep/8. My main problem now is he didn't let us use DECI and we have to use CHARI but I can't make it go from number to number as the user can input up to 40…
0
votes
1 answer

PEP8 ask for a new input if not number

I have this code that converts year input (into chari) and output it as decimal. My problem is, if by mistake, a letter or blank space is entered, the program keeps output the error message but and wont reask for a new input. Example, if ABCD is…
Mobidoy
  • 353
  • 1
  • 3
  • 11
-1
votes
1 answer

Difference between two assembly code

I need help understanding a code in assembly language, in terms of declaring variables as local or global variables. What is the difference between this code ;File: fig0647.pep ;Computer Systems, Fourth edition ;Figure 6.47 ; BR main …
Ahmed Al Abdulaal
  • 270
  • 1
  • 3
  • 16
-1
votes
1 answer

Assume that you have a Pep/8 type computer

Assume that you have a Pep/8 type computer and the following disk files: File A: A Pep/8 assembly language assembler written in machine language. File B: A C++-to-assembly language compiler written in assembly language File C: A C++ program that…
-1
votes
1 answer

Pep/8 Assembly - Finding the correct branch

The program is a basic little calculator that adds, subtracts, or negates whatever number is in answer. The add, subtract, and quit options work fine, but whenever I use N I am unable to input anything after it. I am assuming that something is wrong…
Kenneth
  • 19
  • 7
-2
votes
1 answer

C++ to Pep/8 assembly language

I'm trying to translate a C++ code to Pep/8 assembly language but having a hard time understanding how i can translate a list of values into Pep/8 language such as: val = [ 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, …
Alex
  • 1
-3
votes
2 answers

Finding bytes of memory in Pep9 assembly code

This assembly code takes an input, multiplies it by 35,and leaves result in the register. It's 17 bytes of memory, but how do I calculate that? deci M,d ldwa M,d asla ;2m asla ;4m asla ;8m asla ; 16m adda M,d ; 17m asla ; 34m adda M,d ; 35m
1 2
3