1 Replies - 2295 Views - Last Post: 31 May 2012 - 02:25 PM

#1 rronnyv  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 31-May 12

What's behind int 21h ?

Posted 31 May 2012 - 02:06 AM

INT 21
INT 20

ok this program compiles under ms debug, it sets the system date to 05,29,2033, was looking around the interrupts list and just wanted to try something, anyway the int 21h dets the date, but how does it do it, how do I see what memory locations it accesses.
Is This A Good Question/Topic? 0
  • +

Replies To: What's behind int 21h ?

#2 v0rtex  Icon User is offline

  • Caffeine: db "Never Enough!"
  • member icon

Reputation: 223
  • View blog
  • Posts: 773
  • Joined: 02-June 10

Re: What's behind int 21h ?

Posted 31 May 2012 - 02:25 PM

It is a DOS software interrupt. A interrupt in simplest terms is a signal that gets the "attention" of the CPU. When an interrupt occurs, control is transferred to the operating system which does the relevant action.

int 21 is a multipurpose DOS interrupt that is used for various things (hence multipurpose), it is used for input/output, file handling etc... In this case you are referring to interrupt 2B. Which set's the date:

mov AX,2B 

See here for more on the functions of various int 21 interrupts.

and then you supply the relevant arguments, once you have "setup" your interrupt, the OS takes over and executes the relevant actions. You namely set up the arguments to set the date like follows:
AH = 2B
	CX = year (1980-2099)
	DH = month (1-12)
	DL = day (1-31)

I am not sure about how to view the addresses' that the interrupt accesses as this is in "kernel space" and is normally hidden from the programmer but their might be a debugger out there. The OS does not allow the programmer to access (in general, I may be mistaken/wrong) these addresses as this could aid programmers that are intent to create malicious software by having full access over the kernel.

I hope this helps somehow,

This post has been edited by v0rtex: 31 May 2012 - 02:33 PM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1