Write an assembly program to READ YOUR NAME AND DISPLAY IT IN NEWLINE

Write an assembly program to READ YOUR NAME AND DISPLAY IT IN NEWLINE

title read and display name

dosseg

.model small

.stack 100H

.code

main proc

mov ax, @data ; initialize ds register

mov ds, ax

mov ah, 09h ; display message1

mov dx, offset msg1

int 21h

mov ah, 0ah ; read string

mov dx, offset string

int 21h

mov alt, 09h ; your name is

mov dx, offset msg2

int 21h

mov ah, 09h ; string output

mov dx, offset string

int 21h

mov ax, 4C00H ; return to DOS

int 21H

main endp

end main

.data

msg1 db “Enter your name $”

msg2 db “OAH, ODH, your name is $”

max db 20

len db ?

string db 20 DUP(‘$’)

Write an assembly program to REVERSE THE GIVEN DIGITS

Write an assembly program to REVERSE THE GIVEN DIGITS

title to reverse the given digits

dosseg

.model small

.stack 100H

.code

main proc

mov ax, @data ; initialize ds register

mov ds, ax

mov ax, value1 ; move number to ax

mov cx, 0000h ; remainder r = 0

mov bx, 0010h ; for multiplication by 10h

BACK: mov dx, 0000h ; clear upper 16-bits

div bx ; divide the number ie dx= remainder, ax = quotient

push ax ; push remainder and quotient onto the stack

push dx

mov ax, cx ; r = 0

mul bx ; r = r * 10

pop dx

add ax , dx ; r = r * 10 + n mod 10

mov cx, ax ; keep reverse digits in cx register

pop ax ; or ax, ax ie number = 0

jnz BACK

mov ax, 4C00H ; return to DOS

int 21H

main endp

.data

value1 dw 789A h

list dw 4 dup (?)

end main

Visit our download section to download free simulators/ emulators and other essential engineering softwares or join the free update newsletters now.

Write an assembly program to COPY A BLOCK OF DATA FROM ONE MEMORY TO ANOTHER

Write an assembly program to COPY A BLOCK OF DATA FROM ONE MEMORY TO ANOTHER

title copy a block of data from one memory to another

dosseg

.model small

.stack 100H

.code

main proc

mov ax, @data ; initialize ds register

mov ds, ax

mov SI, offset array1 ; source index

mov di, offset array2 ; destination index

mov cx, 06H ; for 6 data ie cx is implicit counter

BACK: mov al, [SI]

mov [di], al ; move [di], [si]

inc si

inc di

loop BACK ; loop always looks for counter cx

mov ax, 4C00H ; return to DOS

int 21H ; interrupt

main endp

.data

array1 db 01, 02, 03, 04, 05, 06

array2 db 6 dup (?) ; or dup(0) to initialize

result db?

end main

Visit our download section to download free simulators/ emulators and other essential engineering softwares or join the free update newsletters now.

Write an assembly language program (Intel 8086) to READ A STRING, CONVERT IT INTO UPPER CASE AND FINALLY DISPLAY THE CONVERTED STRING

Write an assembly language program (Intel 8086) to READ A STRING, CONVERT IT INTO UPPER CASE AND FINALLY DISPLAY THE CONVERTED STRING

title ALP to read a string, convert it into upper case and display the converted string

dosseg

.model small

.stack 100H

.code

main proc far

mov ax, @data ; initialize ds register

mov ds, ax

 

mov ah, 0ah ; read string

lea ax, param

int 21h

 

mov bx, 00 ; convert to upper string

mov cx, act_len

L2:          mov ah, str [bx]

cmp ah, 41h

jb L1

cmp ah, 51h

ja L1

XOR ah, 00100001B

mov str [bx], ah

L1:          inc bx

loop L2

 

mov ah, 02h ; display newline

mov dl, 0a

int 21h

 

mov ah, 09h ; display string

lead dx, str

int 21h

 

mov ax, 4C00H ; return to DOS

int 21H

main endp

.data

param label Byte
max_men db 60
act_len db ?
str db 60  dup(?)

 

end main

Write an assembly program to CHECK NUMBER OF VOWELS

Write an assembly program to CHECK NUMBER OF VOWELS

title check number of vowels

dosseg

.model small

.stack 100H

.code

main proc

mov ax, @data ; initialize ds register

mov ds, ax

mov si, offset string

mov cx, length ; length in cx register

mov bl, 00 ; vowel = 0

BACK: mov al, [si]

cmp al, ‘a’ ; alternatively cmp al, 41h for comparing if al =41h

jb AHEAD ; jump below if al < 41, discard

cmp al, ‘z’ ; convert the character to upper case

ja VOWEL

sub al, 20h

VOWEL: cmp al, ‘A’

jnz a3 ; go to a3 to check next vowel character

inc bl ; vowel = vowel + 1

jmp a2 ; jump to increment pointer

a3: cmp al, ‘E’

jnz a4 ; go to a4 to check next vowel character

inc bl ; vowel = vowel + 1

jmp a2 ; jump to increment pointer

a4: cmp al, ‘I’

jnz a5 ; go to a5 to check next vowel character

inc bl ; vowel = vowel + 1

jmp a2 ; jump to increment pointer

a5: cmp al, ‘O’

jnz a6 ; go to a6 to check next vowel character

inc bl ; vowel = vowel + 1

jmp a2 ; jump to increment pointer

a6: cmp al, ‘U’

jmp a2 ; jump to increment pointer

inc bl ; vowel = vowel + 1

a2: inc si

loop BACK

mov VOWEL, bl

mov ax, 4C00H ; return to DOS

int 21H

main endp

.data

string db ‘The quick brown fox jumped over the lazy sleeping dog’, ‘$’

length dw $ string

VOWEL db ?

end main

Visit our download section to download free simulators/ emulators and other essential engineering softwares or join the free update newsletters now.

ALP to reverse the given string

title reverse the given string
dosseg
.model small
.stack 100h
.code
main proc
mov ax, @data
mov ds, ax
mov si, offset string ;load base address of string in si register
mov cx, len ;move length in cx register

add si, cx ;character incrementing ie SI=SI+CX, one character beyond string
dec si

BACK: mov dl, [si] ;display character
mov ah, 2
int 21h
dec si ;decrementing address pointer
loop BACK

mov ax, 4c00h
int 21h
main endp

.data
string db ‘This is an ALP’
len dw $-string
end main

ALP to count negative (-ve) numbers from a given list of 10 numbers

title ALP to count negative (-ve) numbers from a given list
of 10 numbers
dosseg
.model small
.stack 100
.code
main proc
mov ax, @data
mov ds, ax
mov cx, 0ah ;counter of 10
mov si, offset list ;array accessing
mov bl, 00h ;counts -ve numbers
mov al, 07Fh ;largest possible +ve number
BACK: cmp al, si ;compares al and si contents
jnc ahead ;if nc=0, jump ahead
inc bl
AHEAD: inc si ;pointer increment
loop back
mov result, bl
mov ax, 4c00h
INT 21h
main endp
.data
list db 0AFH, 03H, 087H……
result db ?
end main

ALP to SUM THE NUMBERS FROM 1-100

title SUM THE NUMBERS FROM 1-100
dosseg
.model small
.stack 100H
.code
main proc
mov ax, 0
mov cx, 10h ; loop count=10
BACK: add ax, cx ; add two numbers
loop BACK ; repeat until cx=0
mov ax, 4c00h ; return to DOS
int 21h
main endp
end main

Find the largest element in a block of data. The length of block is 0A H. Store the maximum value in memory location result. Use an Assembly Language Program for Intel 8086.

Find the largest element in a block of data. The length of block is 0A H. Store the maximum value in memory location result. Use an Assembly Language Program for Intel 8086.

Read More

 

title largest element in a block of data

dosseg

.model small

.stack 100H

.code

main proc

mov ax, @data ; initialize ds register

mov ds, ax

 

mov cx, OA H ; counter = 10

mov al, 00H ; assume the largest number is 00H

mov SI, offset array ; SI initialization

BACK:    cmp al, [SI] ; is next number > maximum

jnc AHEAD ; NC = 0

mov al, [SI] ; yes, replace maximum

AHEAD: inc SI

loop BACK

mov result, al ; move final result to al

 

mov ax, 4C00H ; return to DOS

int 21H

main endp

.data

array db 12, 13, 80, 14, ….. ; total 0A h variables

result db ?

end main

 

Computer Architecture and Design EG633CT

Objectives
To provide basic architectural and designing concepts of computers. This course gives comprehensive view of basic computer architecture.

1. Central Processing Unit: ( 8 hours)
1.1 Hardwired and Microprogramed
1.2 Arithmetic Logic Unit
1.3 Instruction
1.4 Addressing Modes
1.5 Data transfer and manipulation program control ( status, branch, subroutine call, interrupt )

2. Arithmetic Processor Design: ( 8 hours)
2.2 Addition and Subtraction algorithm
2.3 Multiplication and Division algorithm
2.4 Logical Operation
2.5 Processor Configuration
2.6 Design of Control Unit

3. Memory System: (10 hours )
3.1. Microcomputer memory
3.2. Characterization of Memory System
3.3. Random Access Memory (DRAM, SRAM)
3.4. ROM
3.5. Memory Hierarchy
3.6. Memory Mapping

4. Input / Output Organization :( 10 hours )
4.1. Peripheral devices
4.2. Basic Input/Output Interface
4.3. Input/Output Technique (Asynchronous Data transfer, DMA, Priority Interrupt)
4.4. Input/Output Processor
4.5. Data Command Processor

5. The PnP System Architecture: ( 9 hours )
5.1. ISA, PCI and PCMCIA
5.2. PnP Device configuration
5.3. PnP Card Resource Requirements
5.4. PnP BIOS and OS
5.5. PnP POST and Device ROMS
5.6. PnP BIOS Services

Laboratory Exercises:
The laboratory exercises shall be Hands-on Computer architecture project aiming to familiarize students with processor, control, memory, and I/O systems.

References :
1. M. Mano, “ Computer System Architecture”
2. A. Tanenbaum, “ Structured Computer Organization”, 3rd Edition, Prentice Hall, 1990
3. M. Morris Mano, Charles R. Kime, “ Logic and Computer Design Fundamentals”, PHI
4. Tom Shanley, “ Plug and Play System Architecture”, Addison-Wesley publishing company
5. William Stallings, “ Computer Organization and Architecture”, PHI