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

Cohesion, Identify the type of cohesion in the following statements: 1. ...

Identify the type of cohesion in the following statements: 1. Compute average daily temperatures at various sites 2. Initialize sums and open files 3. Create new temperature rec

Avl tree rotation and b tree construction in data structure, Elements are g...

Elements are given 3,14,7,1,8,5,11,17,,6,23,12,20,26,4,16,18,24,25,19 We will construct b tree and avl tree And after that delete some integers

Why do we need registers, Why do we need Registers? If t cpu is cycle...

Why do we need Registers? If t cpu is cycle time of CPU which is the time taken by CPU to execute a well-defined micro-operation employing registers and t mem is memory cycl

Shm, composition of two shm in right angles to each other to havingg time p...

composition of two shm in right angles to each other to havingg time period in the ratio 1:2

Classified the vlsi technology, The VLSI technology is still developing. Mo...

The VLSI technology is still developing. More and more powerful microprocessors and more storage space now are being put in single chip. One question that we have still not conside

Concept of multithreading, Concept of Multithreading: These troubles incre...

Concept of Multithreading: These troubles increase in the design of large-scale multiprocessors such as MPP as discussed above. Thus, a solution for optimizing this latency should

How can a function return a pointer to its calling routine, How can a funct...

How can a function return a pointer to its calling routine? The general form of a function is: type_specifier function_name(parameter list) { body of function; }

Explain bitwise-inclusive-or operato, Bitwise-Inclusive-OR Operator: i...

Bitwise-Inclusive-OR Operator: inclusive-OR-expression : exclusive-OR-expression inclusive-OR-expression | exclusive-OR-expression The  bitwise-inclusive-OR  operator

Define about exe programs, Q. Define about EXE Programs? An EXE program...

Q. Define about EXE Programs? An EXE program is stored on disk with extension .exe. EXE programs are longer than COM programs as every EXE program is related with an EXE header

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