Assembly Language Ass#2
Assembly Language Ass#2
SEAT #:EP-1850081
SEC: A
ASSEMBLY LANGUAGE
SUBMITTED TO:
Question 12:
Suppose memory bytes 0-4 have the following contents
Address Contents
0 01101010
1 11011101
2 00010001
3 11111111
4 01010101
Answers:
- 2 bytes are represented in hex in
format 0xNNNN where N is a hex
number - Address 2 in hex is 0x0011
- Address 3 in hex is 0x00FF
- Bit 7 of byte 2 is 0
Question 13:Convert FAE2CH into binary and decimal
system.
FAE2CH into binary system:
(FAE2CH)16=(11111010111000101100)2
FAE2CH into decimal system:
(FAE2CH)16=(1027628)10
=(15 x 164)+(10 x 164)+(14 x 164)+(2 x 164)+(12 x 164)
=(1027628)10
.model small
.stack 100h .data
msg1 db "Hellow $" msg1
db "Hellow $"
.code
Here msg1 is declared multiple times hence the assembler
would give duplicate error message.
Question 20:How the assembler assign contiguous
memory space for variables? Give example using symbol
table?
Addressing Example
Meaning When used
modes Instruction
Register Add R4,R3 R4 <- R4 + R3 When a value is in a register
Add R4,
Displacement R4 <- R4 + M[100+R1] Accessing local variables
100(R1)
Same as autoincrement.
Auto- R2 <-R2-d
Add R1,-(R2) Both can also be used to implement a
decrement R1 <- R1 + M[R2]
stack as push and pop
General Rules: