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 instruction register, Q. What is Instruction Register? Instruct...

Q. What is Instruction Register? Instruction Register (IR): Here instructions are loaded before execution. Comments on figure above are as below: All representations are

Determine the concepts of object oriented analysis, Determine the concepts ...

Determine the concepts of Object Oriented Analysis  In OOA the initial focus is on identifying objects from the application domain, after that fitting those procedures around

Define the concept of encapsulation of OOA, Encapsulation of OOA Encap...

Encapsulation of OOA Encapsulation separates the interface of an abstraction from its implementation. By taking the above example i.e. of a car, we can now categorize them as:

Unencoded micro-instructions, Unencoded micro-instructions One bit ...

Unencoded micro-instructions One bit is required for each control signal; so number of bits needed in a micro-instruction is high. It represents a detailed hardware vi

Risc architecture - computer architecture, RISC  architecture - computer a...

RISC  architecture - computer architecture: What is reduced regarding it? The answer of this question is that to make all instructions the equal length the number of bits that

Minimis logic function using K-map, Minimise the logic function F (A, B, C,...

Minimise the logic function F (A, B, C, D) = Π M (1, 2, 3, 8, 9, 10, 11,14) ⋅ d (7, 15) Use Karnaugh map.   Ans. Given function F=∏M(1,2,3,8,9,10,11,14).d(7, 15) F'=B'D+B'C+AC+AB'

Write html code to accomplish the web page to insert frame, Write the HTML ...

Write the HTML code to accomplish the web page to insert the frame extending 300 pixels across the page from left side. The HTML code to accomplish the web page is given below

State and prove any one of the demorgen''s laws, Q. F(x,y,z) = ∑m (4,6,7,8...

Q. F(x,y,z) = ∑m (4,6,7,8)+ ∑d (2,5,11,12) Using K-Map. Q. State and prove any one of the DeMorgen's Laws. Show that these theorems can be extended up to any number of variabl

Authentication system differ from a firewall in functioning, How does an au...

How does an authentication system differ from a firewall in functioning?   Authentication vs. firewall User Authentication and Authorization A significant advanced fi

What is meant by branch instruction, What is meant by branch instruction? ...

What is meant by branch instruction? A branch instruction is an instruction which changes the contents of the PC with the branch target address. This address is usually get by

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