MASM

What does the “fh” suffix mean on a number like “38fh” in Intel assembly

最后都变了- 提交于 2021-01-27 21:24:59
问题 I've searched all over the web, but I couldn't find what the "fh" means in the following instruction and eax, 38fh . I know that "h" stands for hexadecimal and "d" for decimal, but I've never seen fh before. 回答1: If an Intel assembler (ie. MASM ) token starts with a number (0 to 9) then it is assumed to be that the entire token is a value. If the value ends with an h the assembler assumes it is H exadecimal. In your case 38fh starts with a number so it is assumed to be a value. The end of the

Calling C function from masm 64

余生长醉 提交于 2021-01-01 06:36:39
问题 I have a problem with my assembly code (64 bit masm in Visual 2013 on win8 64). When I'm calling C function (printf), it throwing exception from ntdll.dll. What I'm doing wrong? How I can read and write data from console in 64 bit masm? Where I can find good tutorial for masm 64 bit? extrn printf : proc .data format byte "Arg1: %d", 10, 0 .code printData proc mov rbx, 100 push rbx lea rax, format; format address push rax call printf; throw unhandled exception ntdll.dll - Access violation

汇编语言教材assembly language

心不动则不痛 提交于 2020-12-17 08:13:44
https://en.wikipedia.org/wiki/Assembly_language https://baike.baidu.com/item/%E6%B1%87%E7%BC%96%E8%AF%AD%E8%A8%80/61826 https://baijiahao.baidu.com/s?id=1590302037132894549&wfr=spider&for=pc 经典教材 汇编语言教材很多,各种处理器都有涉及,粗略统计不下百种。在这么多的教材里,用得较多的可以分类列举如下: x86处理器 1.《x86汇编语言:从实模式到保护模式》, 李忠 著, 电子工业出版社 ,2013-1 。 基于INTEL x86 处理器、NASM编译器和 BOCHS 虚拟机。汇编语言就是处理器的语言,从这个意义上来说,既然学习汇编语言,就必须直接面向硬件编程,而不是使用莫名其妙的 DOS 中断和 API 调用。这是一本有趣的书,它没有把篇幅花在计算一些枯燥的数学题上。相反,它教你如何直接控制硬件,在不借助于 BIOS 、DOS、 Windows 、 Linux 或者任何其他软件支持的情况下来显示 字符 、读取硬盘数据、控制其他硬件等。 我们知道, 32位 和 64位 是主流, 实模式 和DOS操作系统已经成为历史,Linux和Windows都工作在保护模式下。这本书从实模式讲到32位保护模式

Assembly - Round floating point number to .001 precision toward -∞

核能气质少年 提交于 2020-12-10 06:30:28
问题 I am trying to write all my floating point numbers to .001 precision toward -∞. I have set the RC field to 01 binary, but I am only able to print out the initial floating point number with the wanted precision and thereafter it disregards the rounding. I think I might be missing something obvious in how I am handling the precision towards -∞, but I am not sure. INCLUDE Irvine32.inc .data ctrlWord WORD 010000000000b ; set the RC field to round down toward -∞. .code fild sum ; load integer into

Intel assembly syntax OFFSET

别说谁变了你拦得住时间么 提交于 2020-12-01 10:46:05
问题 Now that i know u can use gcc for Intel syntax instead of default at&t with gcc -S -masm=intel test.c There is this line mov DWORD PTR [ebp-16], OFFSET FLAT:base Is it the same as mov dword[ebp-16], base ? Otherwise what must i do? 回答1: Yes, mov dword [ebp - 16], base should be fine. I haven't seen offset flat: for a while - I think it's obsolete, but it's what AT&T's idea of .intel_syntax used to demand (I had to look at Gas's source code to find that out). Means the same as offset to Masm,

x86汇编入门

社会主义新天地 提交于 2020-11-29 15:30:30
Intel® 64 and IA-32 Architectures Software Developer’s Manual 文档官方地址: https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf 很好的入门文档:https://www.ibm.com/developerworks/cn/linux/l-assembly/ 汇编语言由三部分组成: 汇编指令:跟机器指令一一对应,实际就算一个个的助记符。有 AT&T 和 INTEL 两种语法 伪指令:给编译器看,用于指示编译器该如何做。不同编译器的语法不同,有 NASM、GNU as 和 MASM 三种常用编译器 运算符:±*/ 之类的符号 汇编指令 具体可以参考:https://blog.csdn.net/kennyrose/article/details/7575952 AT&T 和 INTEL 两种语法的主要差异有: - AT&T INTEL 操作数方向 从左向右 从右向左 立即数表示方式 $0x01 30h 寄存器表示方式 %eax eax 助记符指定操作数长度 b8位,w16位,l32位, movl $lb, %eax mov eax, dw ptr lb 长跳转和调用 ljmp $sect,

MASM: How to resolve Immediate mode Illegal in 8086 programming?

|▌冷眼眸甩不掉的悲伤 提交于 2020-11-29 10:00:47
问题 I am solving a fundamental question of Assembly Language Programming to add BCD numbers and two ASCII numbers, for that I got that I have to use DAA and AAA instructions respectively, Now I am trying to store the result stored in AX register into my desirable memory location, but not getting that why the following code is giving me error Immediate mode Illegal Below is the code that I have coded till now, please help me that how to eradicate this error PS: I want to move my result into my

MASM x86 Adding two ints

孤者浪人 提交于 2020-11-28 02:45:56
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

MASM x86 Adding two ints

江枫思渺然 提交于 2020-11-28 02:44:51
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be

MASM x86 Adding two ints

最后都变了- 提交于 2020-11-28 02:44:19
问题 I am writing a simple program that takes 3 ints from the user and does the following math: Sum of the first 2 numbers Difference of the second and third numbers Product of all three numbers Quotient (integer) and remainder of first and third numbers There should be output to the user showing the calculation. For example, if the user enters 10, 9, and 8, it should show for the first calculation: 10 + 9 = 19 I'm trying to do the sum at the moment. I was able to calculate it, but I seem to be