本文介绍了什么是Irvine32库,为什么要使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道Irvine32汇编语言库是.

我想要一个定义以及我们为什么要使用此库.

解决方案

Irvine32库是有用功能的集合,您可以查看在线文档以获得它们的列表和更多详细信息.

我不知道为什么使用它.

通常,人们希望使用它来避免自己编写提供该功能的代码.由于复制某些功能的汇编代码可能是数十行或数百行代码(对于非常复杂的功能,甚至可能是数千行),并且每次都要编写它可能很麻烦.

Irvine32函数提供的API通常比OS服务提供的类似API更易于使用,因此使用Irvine32而不是直接调用OS服务通常更简单.

它还提供了读取和打印整数的库函数(例如 WriteDec ),没有系统调用.因此,这就像一个简化的C库printf.并且 ReadDec 返回一个EAX中的值,而FLAGS(CF)中的成功/失败,而C库 scanf 要求您传递一个将存储结果的指针./p>

它是为初学者和简单的程序设计的,不是为了提高效率.例如,Irvine32使用自己的调用约定,而没有调用阻塞寄存器,因此您可以在循环内打印内容,而不必考虑将循环计数器保留在不会继续执行的寄存器中.


脚注1:因为scanf可以在一个调用中进行多次转换,并且因为C不能同时将整数和标志作为两个单独的返回值返回.只有在asm调用约定中才能正常使用在CF中成功/失败的寄存器中返回值.但是,它并不是Irvine32独有的.例如,Mac OS系统调用可以做到这一点.

I want to know that the Irvine32 assembly language library is.

I want a definition and also why we use this library.

解决方案

Irvine32 library is collection of helpful functions, you may check online documentation for list of them and further details.

I don't know why you use it.

Usually one wants to use it to avoid writing the code providing that functionality himself. As the assembly code replicating some of the functionality may be tens or hundreds of lines of code (or even thousands for very complex functions), and having it to write every time may be cumbersome.

Also the API provided by Irvine32 functions is often simpler to use than similar API provided by OS services, so it may be often somewhat simpler to use Irvine32 instead of calling the OS services directly.

It also provides library functions that read and print integers (like WriteDec), which there's no system call for. So it's like a simplified C library printf. And ReadDec returns a value in EAX, and success/fail in FLAGS (CF), while C library scanf requires you to pass a pointer where the result will be stored.

It's designed for beginners and simple programs, not for efficiency. For example, Irvine32 uses its own calling convention with no call-clobbered registers, so you can print stuff inside a loop without having to think of keeping your loop counter in a register that it's not going to step on.


Footnote 1: Because scanf can do multiple conversions in one call, and because C can't return both an integer and a flag as two separate return values. Returning a value in a register with success/fail in CF is something only asm calling conventions can normally use. It's not unique to Irvine32, though. Mac OS system calls do that, for example.

这篇关于什么是Irvine32库,为什么要使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 06:14