Irvine32 和 MASM

发布于 2024-10-10 12:19:36 字数 1456 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

美人迟暮 2024-10-17 12:19:36

如果您使用 masm32 程序,请将 Irvine32.inc 放入 masm32\include 文件夹,将 Irvine32.lib 放入 masm32\lib 文件夹。在源文件 asm write 中,

includelib   \masm32\lib\Irvine32.lib
include      \masm32\include\Irvine32.inc

我在读这本书时成功了!

if you use masm32 program put the Irvine32.inc into masm32\include folder and Irvine32.lib in masm32\lib folder. In source file asm write

includelib   \masm32\lib\Irvine32.lib
include      \masm32\include\Irvine32.inc

I successed when i was reading this book!

若沐 2024-10-17 12:19:36

您提到的库与 Kip Irvine 的书“x86 处理器的汇编语言”一起使用。目前它已经是第六版了,我发现它是对装配的一个很好的介绍。

在前面的章节中(我认为是第 3 章),他回顾了包含过程。它说明了放置文件的位置等,可能对您有一些帮助(我会在这里记录它,但有点复杂)。

干杯,

斯科特

The library you mention is used with Kip Irvine's book, "Assembly Language for x86 Processors". It's currently in its' sixth edition and I am finding it to be a great intro to assembly.

In the early chapters (chapter 3, I believe), he goes over the include process. It states where to put files, etc. and may be of some help to you (I'd document it here, but it's a little involved).

Cheers,

Scott

眼眸印温柔 2024-10-17 12:19:36

本书的示例附带了一个演示项目,您可以使用该项目作为您的项目的基础。您还应该检查链接器设置,并确保 Irvine32 库的路径包含在附加库依赖项属性中。我曾经遇到过这个问题,只是使用 Kip 书中附带的默认项目创建了一个模板项目。

请访问我的博客设置 vs10 以使用 masm32 进行编程,详细了解如何将库添加到一个 masm32 项目。

There is a demo project that comes with the examples for the book, you can use that project as a basis for your project. You should also check your linker settings, and make sure the paths to Irvine32 libraries are included in the additional library dependencies property. I had that issue once and just created a template project using the default project that is shipped Kip's book.

Visit my blog Setting up vs10 for programming with masm32 for details on how to add libraries to a masm32 project.

别理我 2024-10-17 12:19:36

TITLE MASM 模板 (Template.asm)

包括 Irvine32.inc

.data
销售 DWORD 7050、8020、3502、6750、4435、5000、7800、5100、6350、8300、2750、7340
计算 EQU 长度销售量
总计双字 72397
平均双字?
最高双字?
msgTotal BYTE "总销售额为:", 0
msgAvg BYTE "平均销售额为:", 0
msgHighest BYTE "最高销售额是:", 0

.code
主程序

; TOTAL sales
mov     ecx, COUNT 
mov edi, 0

L1:

mov    eax, sales [edi]      ; EAX = Sales[0]
add    TOTAL, eax            ; Total = Total + EAX
add    edi, TYPE sales       ; EDI = EDI + 4
loop   L1

; AVERAGE sales
mov    eax, TOTAL
mov    ecx, COUNT
div    ecx                   ; EAX = EAX / COUNT
mov    AVG, eax

mov    edx, OFFSET msgAVG
call   writestring

mov    eax, AVG
call   writestring
call   writedec
call   Crlf

; HIGHEST sales
mov   ecx, COUNT
mov   edi, 0

L2: mov eax, Sales[edi] ; EAX = 销售额[0]
cmp eax,最高
L3 ; EAX>销售量
跳转L4; EAX <销售

L3:mov 销售,eax ;销售额=EAX
jmp L4

L4: 添加 edi, TYPE Sales ;电子数据交换 = 电子数据交换 + 4
环路L2

mov   edx, OFFSET   msgHighest 
call  writestring

mov   eax, HIGHEST
call  writedec
call  Crlf


exit

主ENDP
结束主

TITLE MASM Template (Template.asm)

INCLUDE Irvine32.inc

.data
sales DWORD 7050, 8020, 3502, 6750, 4435, 5000, 7800, 5100, 6350, 8300, 2750, 7340
COUNT EQU LENGTHOF sales
TOTAL DWORD 72397
AVG DWORD ?
HIGHEST DWORD ?
msgTotal BYTE "Total Sales is : ", 0
msgAvg BYTE "Average Sales is: ", 0
msgHighest BYTE "Highest Sales is: ", 0

.code
main PROC

; TOTAL sales
mov     ecx, COUNT 
mov edi, 0

L1:

mov    eax, sales [edi]      ; EAX = Sales[0]
add    TOTAL, eax            ; Total = Total + EAX
add    edi, TYPE sales       ; EDI = EDI + 4
loop   L1

; AVERAGE sales
mov    eax, TOTAL
mov    ecx, COUNT
div    ecx                   ; EAX = EAX / COUNT
mov    AVG, eax

mov    edx, OFFSET msgAVG
call   writestring

mov    eax, AVG
call   writestring
call   writedec
call   Crlf

; HIGHEST sales
mov   ecx, COUNT
mov   edi, 0

L2: mov eax, Sales[edi] ; EAX = Sales[0]
cmp eax, HIGHEST
ja L3 ; EAX > SALES
jmp L4 ; EAX < SALES

L3: mov Sales, eax ; Sales = EAX
jmp L4

L4: add edi, TYPE Sales ; EDI = EDI + 4
loop L2

mov   edx, OFFSET   msgHighest 
call  writestring

mov   eax, HIGHEST
call  writedec
call  Crlf


exit

main ENDP
END main

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文