Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS401 VU Current Assignment No. 3 idea solution Fall December 2011
#1
ssignment No. 03

Semester: Fall 2011

CS401: Computer Architecture and Assembly Language Programming

Total Marks: 20

Due Date:29th December, 2011



Assignment

You are required to write an Assembly program that shall be executed as Terminate and Stay Resident (TSR) program and performs the following operations.



When the key h is pressed, string Hello will be displayed on screen.
When the key w is pressed, string World will be displayed on screen.
When the key c is pressed, whole screen will be cleared.



HINT:

You can check which key is pressed with the help of keyboard interrupt.

SOLUTION:

Programme code following

[org 0x100]



jmp start



msg1: db ‘Hellow’,0

msg2: db ‘World’,0



clrscr: push es

push ax

push cx

push di

mov ax,0xb800

mov es,ax

xor di,di

mov ax,0×0720

mov cx,2000



cld

rep stosw

pop di

pop cx

pop ax

pop es

ret

strlen: push bp

mov bp,sp

push es

push cx

push di

les di,[bp+4]

mov cx,0xffff

xor al,al

repne scasb

mov ax,0xffff

sub ax,cx

dec ax

pop di

pop cx

pop es

pop bp

ret 4

printstr: push bp

mov bp,sp

push es

push ax

push cx

push si

push di



push ds

mov ax,[bp+4]

push ax

call strlen

cmp ax,0

jz exit

mov cx,ax



mov ax,0xb800

mov es,ax

mov al,80

mul byte [bp+8]

add ax,[bp+10]

shl ax,1

mov di,ax

mov si,[bp+4]

mov ah,[bp+6]



cld

nextchar: lodsb

stosw

loop nextchar

exit: pop di

pop si

pop cx

pop ax

pop es

pop bp

ret 8



start:

mov ah,0

int 0×16

mov ax,0

push ax

mov ax,0

push ax

mov ax,0×71

push ax

mov ax,msg1

push ax

call printstr



mov ah,0

int 0×16

mov ax,2

push ax

mov ax,2

push ax

mov ax,0×71

push ax

mov ax,msg2

push ax

call printstr

mov ah,0

int 0×16

call clrscr

mov ah,0

int 0×16



mov ax,0x4c00

int 0×21



0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,320 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,905 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,926 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,162 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,240 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,964 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,661 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,795 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,698 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,795 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)