IA-32 Floating Point Unit

Introduction:

The Floating-Point Unit (FPU) provides high-performance floating-point processing capabilities for use in graphics processing, scientific, engineering, and business applications.

The FPU represents a separate execution environment within the IA-32 architecture. This execution environment consists of 8 data registers and following special purpose registers.

  • The status register
  • The counter register
  • The tag word register

Mechanism:

The FPU data register consists of eight 80-bits registers. Values are stored in these register in the double extended-precision floating point format. When floating-point, integer, or packed BCD integer values are loaded from memory into any of the FPU data registers, the values are automatically converted into the double extended-precision floating-point format (if they are not already in that format). When computation results are subsequently transferred back into memory from any of the FPU registers, the results can be left in the double extended-precision floating-point format or converted back into a shorter floating-point format, an integer format, or the packed BCD integer format.

The FPU instructions treat the eight FPU data register as a register stack.All addressing of the data registers is relative to the register on the top of the stack.

floatingstack.gif

The register number of the current top-of-stack register is stored in the TOP (stack TOP) field in the FPU status word. Load operations decrement TOP by one and load a value into the new top-of-stack register, and store operations store the value from the current TOP register in memory and then increment TOP by one. (For the FPU, a load operation is equivalent to a push and a store operation is equivalent to a pop.) Note that load and store operations are also available that do not push and pop the stack.

Read More »

SAP – 1 Processor

Architecture Introduction

The Simple-As-Possible (SAP)-1 computer is a very basic model of a microprocessor. The SAP-1 design contains the basic necessities for a functional Microprocessor. Its primary purpose is to develop a basic understanding of how a microprocessor works, interacts with memory and other parts of the system like input and output. The instruction set is very limited and is simple.

1537093478378.png

1. Program Counter

The program is stored at the beginning of the memory with the first instruction at binary address 0000, the second instruction at 0001, the third at address 0010 and so on. The program counter which is part of the control unit, counts from 0000 to 1111. Its job is to send to the memory the address of the next instruction to be fetched and executed. It does this as mentioned in the next paragraph.

The program counter is reset to 0000 before each computer run. When the computer run begins, the program counter sends the address 0000 to the memory. The program counter is then incremented to get 0001. After the first instruction is fetched and executed, the program counter sends address 0001 to the memory. Again the program counter is incremented. After the second instruction is fetched and executed, the program counter sends address 0010 to the memory. So this way, the program counter keeps track of the next instruction to be fetched and executed.

The program counter is like someone pointing a finger at a list of instructions saying do this first, do this second, do this third, etc. This is why the program counter is called a pointer; it points to an address in memory where the instruction or data is being stored.

Read More »

Run MASM on Linux

In this blog, I am going to show you the step by step method to run masm on linux.let’s start.

Dosbox Installation:

First thing you have to do is to instal dosbox on linux via command:

sudo apt install dosbox

That’s it now you can run your masm program on linux.

 

Run MASM:

So, let me show you a demo of how to run the programs using dosbox.Click here
to download masm folder in your system.(This link will direct you to my github repo.From where you can clone masm. ).

Now run the dosbox by typing simple command in your terminal:

dosbox

Mount the location where the downloaded masm folder is available.My masm folder is in Documents.

mount c /home/yourusername/Documents/masm

This will be the output.Screenshot from 2018-09-15 15-01-35

When it is mounted and change your present working directory to C. To do this simple type this command in dosbox:

Read More »