Write a subroutine in c for toggling the cursor, Computer Engineering

Assignment Help:

Write a subroutine in C for toggling the cursor using old directives.

;

; use small memory model for C - near code segment

_DATA SEGMENT WORD   'DATA'

  CURVAL EQU   [BP+4]   ; parameters

_DATA   ENDS

_TEXT                     SEGMENT        BYTE              PUBLIC         'CODE'

DGROUP                GROUP _DATA

                                 ASSUME CS:_TEXT,  DS:DGROUP,  SS:DGROUP

                                 PUBLIC _CURSW

_CURSW PROC    NEAR

                                 PUSH    BP    ; BP register of caller is saved

                                 MOV    BP, SP    ; BP is pointing to stack now

                                 MOV   AX, CURVAL

                                 CMP   AX, 0H

                                 JZ    CUROFF; Execute code for cursor off

                                 CMP   AX, 01H  

                                 JZ    CURON; Execute code for cursor on

                                 JMP    OVER    ; Error in parameter, do nothing 

CUROFF:      ; write code for curoff

:

 :

                                  JMP   OVER

CURON:      ; write code for curon

:

 :

OVER:                        POP BP

                                    RET

_CURSW                    ENDP

_TEXT                        ENDS

  END

Why the parameter is found in [BP+4]? Please look into the following stack for answer.

1448_Write a subroutine in C for toggling the cursor.png


Related Discussions:- Write a subroutine in c for toggling the cursor

Explain the different page replacement policies, Explain the different page...

Explain the different page replacement policies. Various page replacement algorithms are briefly explained below: 1. First-in, first-out FIFO page replacement algorith

What is the purpose of guard bits, What is the purpose of guard bits used i...

What is the purpose of guard bits used in floating point operations? The guard bits are the extra bits which are used to retain the in-between steps to enhance the accuracy in

Describes the phases of sdlc, Software Development Life Cycle (SDLC):- SDLC...

Software Development Life Cycle (SDLC):- SDLC (System Development Life Cycle) is a well-defined process by which a system is conceived developed and implemented. In other sense a S

Determine the bandwidth required for transmission, A PCM system uses 8 bits...

A PCM system uses 8 bits per sample and the analog signal is limited to 4.3 kHz. The PCM data is transmitted using (a) BFSK and (b) ASK. Determine the bandwidth required for transm

Hard disk technology - computer architecture, Hard Disk Technology: Fi...

Hard Disk Technology: Figure of a computer hard disk drive           HDDs record data by magnetizing ferromagnetic material directionally, to represent

How do you make an image clickable in HTML, How do you make an image clicka...

How do you make an image clickable in HTML? Give an example. To create an image or text clickable hyperlinks are used, that use the and tags. Such tag has different paramet

What is the protocol used by sap gateway process, What is the protocol used...

What is the protocol used by SAP Gateway process? The SAP Gateway method communicates with the clients based on the TCP/IP Protocol.

How do you turn off cookies for one page in your site, How do you turn off ...

How do you turn off cookies for one page in your site?  Use the Cookie. Discard Property which Gets or sets the discard flag set by the server. When true, this property initiat

What is one-way association, What is one-way association? One-way assoc...

What is one-way association? One-way association means association will traverse in only in one direction and implement using the actual implementation. If the multiplicity is

Explain logical shifts with example, Q. Explain Logical shifts with example...

Q. Explain Logical shifts with example? Logical shifts LOGICAL SHIFT LEFT and LOGICAL SHIFT RIGHT insert zeros to end bit position and other bits of a word are shifted left or

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd