assembly language about interrupt 21h,thanks
why
Code:
int 21h function 6 Code:
Code:
mov ah,6 thanks very much |
Hi,
The "int 21" cluster (as I use to call it) is a collection of sub funtions. Int 21 does pretty much. You address the sub funtions with a code in AH (as you seem to have done) and let that info be a "parameter" for the int 21 function. Int 21 is pretty much a work horse... AH = 02 writes to stdout, and AH = 09 reads from the stdin... Thor |
DOS functions (to be clear) are accessed throught he software interrupt 21H. All parameter passing is done through registers, with the AH register always containing the function code. Other registers are used according to the requirements of the function. Examples of common uses of registers or register pairs are 'DL' holding single byte data, 'DS:DX' pointing to input buffer, and 'AL' used as the return status of the function call. I haven't done any DOS assembler programming for a couple of decades, but when I did I always had one of my copies of the Programmers's PC Sourcebook by Thom Hogan nearby. In it, he says function 09H is 'Display String'. The definitive online guide to PC real-mode programming has long been Ralf Brown's Interrupt List, and in it you can find the table of Int21H functions.
MS-DOS has a fairly weak concept and implementation of 'stdout' and 'stdin', and I always resist the temptation to use those terms in the context of DOS. --- rod. |
topheraholic -
Please remember that everything you do with Int 21, MS-DOS and 16-bit assembler is *completely* obsolete. If you really want to learn assembler, this is probably a much better reference: Programming from the Ground Up, Jonathan Bartlett Here's a free download of an older (but still very useful) edition: http://savannah.nongnu.org/projects/pgubook/ PS: Here's another good book - about 32-bit Linux assembler - that I own and heartily recommend: Professional Assembly Language, Richard Blum |
oh,thanks you guys!it helped so much!!! i learn assembly language because i wanna do reversing!
|
All times are GMT -5. The time now is 03:48 PM. |