Assembly Programs-Computer Programming For Aeronautical Engineering And Sciences-Lecture Slides, Slides of Aeronautical Engineering

Prof. Balamohan Pawar delivered this lecture at Allahabad University for Aeronautical Engineering and Computer Programming course. Its main points are: Machine, Assembly, SimpSim, Brookshear, Architecture, Format, Instruction, Logical, Operator

Typology: Slides

2011/2012

Uploaded on 07/20/2012

savitha_48
savitha_48 🇮🇳

3

(1)

109 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assembly programs
Example: Add three numbers together.
The values to added should be placed in
memory locations 10h, 11h and 12h.
The sum should be placed in memory
position 13h.
Example: Write a program that
converts lowercase to uppercase ASCII
character stored in a memory.
The Brookshear Machine
and SimpSim Assembly
16 General purpose registers
– Numbered 0-F (0-15)
256 8-bit-size memory cells
– Numbered 00-FF (0-255)
15 simple instructions
– Encoded using 2 bytes per instruction
– Hex notation: 4 hex digits per instruction
• MSB hex for the opcode
• The other three hex digits for the operands
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Assembly Programs-Computer Programming For Aeronautical Engineering And Sciences-Lecture Slides and more Slides Aeronautical Engineering in PDF only on Docsity!

Assembly programs

• Example : Add three numbers together.

The values to added should be placed in

memory locations 10h, 11h and 12h.

The sum should be placed in memory

position 13h.

• Example : Write a program that

converts lowercase to uppercase ASCII

character stored in a memory.

The Brookshear Machine

and SimpSim Assembly

• 16 General purpose registers

– Numbered 0-F (0-15)

• 256 8-bit-size memory cells

– Numbered 00-FF (0-255)

• 15 simple instructions

– Encoded using 2 bytes per instruction

– Hex notation: 4 hex digits per instruction

• MSB hex for the opcode

• The other three hex digits for the operands

The Brookshear Architecture

Brookshear Instruction Format

Masking: Reading

• Example : Determine if a number is odd or even.

Even Number Odd Number

AND 000000001 AND 0000000001

complement represents a positive or a negative number. What

number

bit-mask

result

Masking: Setting

• An OR operation can be used to set a bit in a string to the

value 1.

• Example : Change the MSB in a byte to a 1.

OR 10000000

• Exercise : If you want to change the bit stream 10011101 into

becoming 11011101 , what bit-mask, and what Boolean

operator would you use?

By examining the result of the masking operation, you can

determine the number as odd or even: If the result is 0, it is even

Exercise : Determine if a byte (8 bits in memory) in 2’s

bit-mask and what logic operation would you use?

Masking: Clearing/Re-setting

• To change a bit in a bit string to value 0

can be done using an AND operation with a 0 in the

position that needs to be set to 0 and a 1 in all other

positions.

• Example :

AND 0 1111111

Masking: Exercises

1. What mask and operator is needed to convert lower case ASCII

Hint

0100 0001, etc. ]

2. Given two bytes. Create a third byte that combines the first

half of the 1st^ byte (4 bits) with the last half of the 2nd^ byte (

bits).

– 01101001 and 11100111 , the answer

would be 01100111.

to do this?

BACK

character to uppercase character? E.g., ‘u’ should be changed to

‘U’, ‘n’ to ‘N’ and so on…

: take a look at the ASCII values for characters represented

in binary notation [ASCII for ‘a’ = 0110 0001, ASCII for ‘A’ =

For example, given

What sequence of logical operations using bit masks are needed