473,698 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused about C program with assembly

87 New Member
Hi

In my college they have given me the following codings for implementing linker function.

Codings:

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<conio.h>
  3. void cursoron();
  4. void cursoroff();
  5. void main()
  6. {
  7. clrscr();
  8. printf("LINKER\n\n");
  9. printf("Cursor off state\n");
  10. cursoroff();
  11. getch();
  12. printf("\nCursor on state\n");
  13. cursoron();
  14. getch();
  15. printf("\nCursor off state\n");
  16. cursoroff();
  17. getch();
  18. printf("\nCursor on state\n");
  19. cursoron();
  20. getch();
  21. }
  22.  
  23. void cursoron()
  24. {
  25.  asm MOV AH,3;
  26.  asm XOR BX,BX;
  27.  asm INT 0X10;
  28.  asm XOR CH,0X3F;
  29.  asm MOV AH,1;
  30.  asm INT 0X10;
  31. }
  32.  
  33. void cursoroff()
  34. {
  35.  asm MOV AH,3;
  36.  asm XOR BX,BX;
  37.  asm INT 0X10;
  38.  asm OR CH,0X3F;
  39.  asm MOV AH,1;
  40.  asm INT 0X10;
  41. }
Output:

Cursor off state

Cursor on state
-

Cursor off state

Cursor on state
-


- indicates blinking cursor in output.
I know the assembly language codings only a little bit. Can you please explain me what each assembly language statements are doing for cursoron() function alone so that i can understand cursoroff() function also.

I know the meaning of MOV,XOR,INT,OR etc.. But what is the purpose of moving values 3,1 in A register before and after cursor on/off stage and why we are clearing BX register,why we are moving 0X3F in CH register. What actually they do.

Can u please explain me...
Oct 30 '07 #1
1 1901
Cucumber
90 New Member
It is imperative to have the interruption's documentation prior to coding anything related to sowftare interruptions.

In your case, you need to take a look to this link
http://www.ctyme.com/intr/int-10.htm

There you can lookup what does the software interruption 0x10 do when you "feed" it AH = 3 and so on.

For instance, AH=3 means "VIDEO - GET CURSOR POSITION AND SIZE", AH=1 means "VIDEO - SET TEXT-MODE CURSOR SHAPE", and so on,

Just click and read.
Oct 31 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
39372
by: James | last post by:
Im having trouble building/running a program which was written under Visual Studio 2000 & .NET Framework 1.0. Im now using a new installation of .NET 1.1 with Visual Studio 2003, otherwise there have been no changes to the code. Although there appears to be no build errors, the program terminates almost as soon as it has begun with the debug message The program ' HSEC_TMS.exe' has exited with code 0 (0x0). Any ides?! Here is the full...
7
1719
by: Steve Richter | last post by:
When I build a C# class and install it in the GAC, my code works as it should, my .aspx code finds the DLL and can run a static method: <%@ Assembly Name="AutoCoder, Culture=neutral, Version=1.0.1922.22245, PublicKeyToken=0a4067d718757385" %> <%@ Import Namespace="AutoCoder" %> Trace.Write( "AutoCoder", AutoCoder.Common.GetConnectionString( )) ; But I cant locate the assembly in its directory using the src= property.
11
2495
by: herpers | last post by:
Hello, I probably don't see the obvious, but maybe you can help me out of this mess. The following is my problem: I created two classes NormDistribution and DiscDistribution. Both classes provide an implemation of the operator +. Now I want to write another generic class Plan<DType>, which can
1
1272
by: Giulio Petrucci | last post by:
Hi everybody, I'm getting confused about "which-name-give-to-what" developing my applications using Visual Studio. If I have to develop a "Utilities" library containing some classes for logging and other classes used for cryptography shall I build a new Solution named "Utilities"? And how many projects shall I set in it? Let's suppose I need to have two namespaces "Utilities.Log" and "Utilities.Cryptography", in the same assembly......
2
1371
by: Giulio Petrucci | last post by:
Hi everybody, I'm getting confused about "which-name-give-to-what" developing my applications using Visual Studio. If I have to develop a "Utilities" library containing some classes for logging and other classes used for cryptography shall I build a new Solution named "Utilities"? And how many projects shall I set in it? Let's suppose I need to have two namespaces "Utilities.Log" and "Utilities.Cryptography", in the same assembly......
5
2628
by: Igor | last post by:
Hi! We built VB6 application to work with Reporting Services server. To connect to reporting server has been created a special assembly with .NET VS2003. While we execute our program on local machine, every thing works. But when we put the whole program on network drive, the VB6 program could not create required object from .NET assembly. Nothing we done were not useful to help to solve the problem. Does anybody have idea?
13
2202
by: VijayJaiswal | last post by:
How can i make and execute assembelly language programes in c language. I have not make a single assembelly program yet, so please give a small example. Also mension all the instructions necessary, so that i can make and execute assembely language programme on c compiler.
2
2013
by: Jan Althaus | last post by:
Mostly for testing reasons I'd like to see if it makes sense to chose the following approach for just-in-time compilation of shaders for a renderer: Seeing as the shaders themsefs consist mostly of very basic operations I'd like to translate them into assembly, have an assembler compile the binary code and then call the resulting machine code from c++. The thing is that up until now I have only used inline assembly in my c++ projects,...
2
1424
by: =?Utf-8?B?UGFi?= | last post by:
Hello, I am confused with load assembly in AppDomain. I created ASP Web application, same business logic is realized in custom DLLs, and I need to load ones in my application. If I use ‘Load(assmblyRef)’ method of AppDomain class, assembly is loaded but DLL file locked. I try to read DLL in byte array and load assembly calling Load(byte) method. All are pretty, but in contrast to calling Load(assmblyRef)’ method, calling...
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.