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

Define interrupts in assembly language, Q. Define Interrupts in assembly la...

Q. Define Interrupts in assembly language? An interrupt causes interruption of an ongoing program. A number of the common interrupts are: printer, monitor, keyboard, an error c

Explain the working of dynamic ram - computer memory, Explain the working o...

Explain the working of Dynamic RAM? A plain piece of hardware called a DRAM controller can be used to make DRAM behave more like SRAM and the job of the DRAM controller is to p

Difference among interrupt service routine and subroutine, Subroutine are t...

Subroutine are the part of implementing processes (like any process can call a subroutine for achieve task), whereas the interrupt subroutine never be the part. Interrupt subroutin

Explain the working of thousand line exchanges, E xplain the working of th...

E xplain the working of thousand line exchanges by u sing a combination of uniselectors and two motion selectors. The schematic diagram for such an exchange is demonstrated i

Define throughput, Define throughput?  Throughput in CPU scheduling is ...

Define throughput?  Throughput in CPU scheduling is the number of processes that are completed per unit time. For long processes, this rate might be one process per hour; for s

Program in java, Write a program to display grade message according to the ...

Write a program to display grade message according to the marks

Determine the output waveforms for and and or gates, The voltage waveforms ...

The voltage waveforms shown in given fig. are applied at the inputs of 2-input AND and OR gates. Determine the output waveforms. Ans. The Output waveforms for AND and O

What are multidimensional arrays, What are Multidimensional Arrays? Mul...

What are Multidimensional Arrays? Multidimensional array: Multidimensional arrays can be defined as "arrays of arrays". For example, a bidimensional array can be fictional as a

Modular programming, Modular programming denotes to the practice of writing...

Modular programming denotes to the practice of writing a program as a sequence of independently assembled source files. Every source file is a modular program intended to be assemb

Constructor, what is meant by private copy constructor

what is meant by private copy constructor

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