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 a multiprogramming operating system, Explain a multiprogramming ope...

Explain a multiprogramming operating system? A multiprogramming operating system: It is system which allows more than one active user program or part of user program to be st

What is virtual memory, What is virtual memory? Method that automatical...

What is virtual memory? Method that automatically move program and datablocks into the physical main memory when they are needed for execution are known as virtual memory.

Determine by which final selector is connected, The final selector is conne...

The final selector is connected to the (A) calling subscriber.                     (B) switching network. (C) called subscriber.                      (D) li

What are prefetch instructions, What are prefetch instructions? Prefetc...

What are prefetch instructions? Prefetch instructions are those instructions which can be inserted into a program either by the programmer or by the compiler.

#title, what are the applications of microprogramming

what are the applications of microprogramming

Determine through which symbolic names can be associated, Determine Symboli...

Determine Symbolic names can be associated with Symbolic names can be associated with the data or instruction

How do you detect if two 8-bit signals are same, By using XNOR gate if the ...

By using XNOR gate if the signals are similar then only the output will be one otherwise not.

Explain the program translation model, Explain the program translation mode...

Explain the program translation model The program translation model makes the execution gap through translating a program written in a programming language, termed as the sou

Determine the synchronization of bits, Determine the synchronization of bit...

Determine the synchronization of bits The synchronization provided by use of start and stop bits, an extra bit known as a parity bit may optionally be transmitted along with th

Delete the leaves of a binary tree, Write a recursive algorithm to delete t...

Write a recursive algorithm to delete the leaves of a binary tree. Programming Requirements You must use the binary search tree code provided.  Each algorithm must be impleme

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