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

What is mask operation, What is MASK OPERATION The mask operation is si...

What is MASK OPERATION The mask operation is similar to selective-clear operation except which the bits of Aare cleared only where there are corresponding 0's in register B. th

What is meant by context switch, What is meant by context switch?  Swit...

What is meant by context switch?  Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task i

Information system and information technology, (a) Explain the following te...

(a) Explain the following terms: Information System and Information Technology. (b) Describe the main components of a computer. Illustrate your answer by a block diagram. (c)

When recursion functions are declared inline, Describe what happens when re...

Describe what happens when recursion functions are declared inline? Ans) Inline functions property says whenever it will call; it will copy the whole definition of that functi

What is a service in sap terminology, What is a Service in SAP terminology?...

What is a Service in SAP terminology? A service refers to something offered by an s/w component.

Categorize the cpu scheduling algorithms, Categorize the CPU scheduling alg...

Categorize the CPU scheduling algorithms? The various CPU scheduling algorithms are categorized as given below:

Synchronous sequential circuits, Q. Differentiate the Multiplexer and Demul...

Q. Differentiate the Multiplexer and Demultiplexer with respect to their concept, block diagram and circuit. Q. What is the difference between Synchronous sequential circuits an

Determine the purpose of GDTR, Elucidate the purpose of GDTR. If the microp...

Elucidate the purpose of GDTR. If the microprocessor sends linear address 00200000H to paging mechanism, which paging directory entry and which page table entry is accessed? GD

How can i pass parameters to my simulation, How can I pass parameters to my...

How can I pass parameters to my simulation? A  test  bench  and  simulation  would likely  need  many  different  parameters  and  settings  for  various sorts of tests and con

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