MASM

MASM under Linux?

本秂侑毒 提交于 2020-01-12 06:45:12
问题 Is there a way that I use MASM under Linux. Even tough NASM is quite popular under Linux, it still differs for some instruction style on code. 回答1: Wiki says The MASM32 EULA does not allow its usage in the development of open source software, and only allows it to be run in Windows operating systems. so it is a no. 回答2: I use DosBox and it does work fine for me. Details here 回答3: You should be able to run MASM under Wine. 回答4: MASM dont run with WINE, im running MASM under Virtual Box 回答5:

SHR and SAR Commands

喜欢而已 提交于 2020-01-11 14:25:10
问题 I would like to make sure I am understanding this concept 100% and if not get some clarification. In an asm program, if you perform SHR 00110000b you would end up with 00011000b . However, if you were to perform SHR on 11111111b you would end up with an incorrect answer and should use SAR instead? This is because the number is signed? 回答1: if you perform SHR 00110000b you would end up with 00011000b If you shifted one bit to the right, yes. You can specify the shift amount, so it's not fixed

SHR and SAR Commands

北城以北 提交于 2020-01-11 14:24:06
问题 I would like to make sure I am understanding this concept 100% and if not get some clarification. In an asm program, if you perform SHR 00110000b you would end up with 00011000b . However, if you were to perform SHR on 11111111b you would end up with an incorrect answer and should use SAR instead? This is because the number is signed? 回答1: if you perform SHR 00110000b you would end up with 00011000b If you shifted one bit to the right, yes. You can specify the shift amount, so it's not fixed

Why operand must have size in one line but not the other in x86 assembly

回眸只為那壹抹淺笑 提交于 2020-01-11 14:06:50
问题 Looking at the picture, on line 34 I had to write the word ptr for this to work, while on line 44 I didn't. Why is that? Can't the compiler know that 0020h is a word just like 0FF20h is a word? Adding 0 to 0020h making it 00020h or anything like that doesn't work either. I am using MASM on 80x86. emu8086, also tried on dosbox v0.74 回答1: The difference is because your assembler strangely and dangerously accepts 0FF20h as implying word operand-size. But even for your assembler, leading zeros

Why operand must have size in one line but not the other in x86 assembly

十年热恋 提交于 2020-01-11 14:06:27
问题 Looking at the picture, on line 34 I had to write the word ptr for this to work, while on line 44 I didn't. Why is that? Can't the compiler know that 0020h is a word just like 0FF20h is a word? Adding 0 to 0020h making it 00020h or anything like that doesn't work either. I am using MASM on 80x86. emu8086, also tried on dosbox v0.74 回答1: The difference is because your assembler strangely and dangerously accepts 0FF20h as implying word operand-size. But even for your assembler, leading zeros

Disabling desktop composition causes flickering on Tab Control

对着背影说爱祢 提交于 2020-01-11 13:36:26
问题 When i disable desktop composition i get flickering/blinking whenever i hover the mouse over the tabs. This only happens when desktop composition is disabled. I have tried to cancel WM_ERASEBKGND message but it doesn't fix the problem. What is the solution to this problem? This is the example that i tried to use for MASM tab control. http://www.dreamincode.net/forums/index.php?app=core&module=attach&section=attach&attach_id=28600 The bin is already compiled. EDIT: After enabling the WS_EX

Print figure of hangman in assembly

我们两清 提交于 2020-01-07 06:17:05
问题 Is there a better way to print a hangman figure? FIG0 DB 0DH,0AH,' +=======+',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$' FIG1 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$' FIG2 DB 0DH,0AH,' +=======+',0DH,0AH,' | |',0DH,0AH,' O |',0DH,0AH,'/ |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' |',0DH,0AH,' ========+',0DH,0AH,'$' FIG3 DB 0DH,0AH,' +

Concatenating strings from registers and printing them

落花浮王杯 提交于 2020-01-07 02:12:13
问题 I am trying to call cpuid and print output from EBX, ECX and EDX to console, but it prints empty line instead here is my code: .586 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc includelib \masm32\lib\kernel32.lib .data .data? mybuffer byte 100 dup(?) .code start: mov eax, 0 cpuid invoke lstrcpy, addr mybuffer, ebx invoke lstrcat, addr mybuffer, ecx invoke lstrcat, addr mybuffer, edx invoke GetStdHandle, STD_OUTPUT_HANDLE

Concatenating strings from registers and printing them

↘锁芯ラ 提交于 2020-01-07 02:12:08
问题 I am trying to call cpuid and print output from EBX, ECX and EDX to console, but it prints empty line instead here is my code: .586 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc includelib \masm32\lib\kernel32.lib .data .data? mybuffer byte 100 dup(?) .code start: mov eax, 0 cpuid invoke lstrcpy, addr mybuffer, ebx invoke lstrcat, addr mybuffer, ecx invoke lstrcat, addr mybuffer, edx invoke GetStdHandle, STD_OUTPUT_HANDLE

Tracing a NCR assembly program of MASM

岁酱吖の 提交于 2020-01-06 03:55:23
问题 I missed the session when our lecturer explained it.. I know the formulae for NCR NCR = N! / (R! * (N-R)!) I am not following the NCR PROC , as no factorial is found, and some creepy recursive jobs are being done there. Help would be really appreciated. print macro str lea dx,msg mov ah,09h int 21h endm .model small .data n dw 15 r dw 6 ncr dw 1 msg db "The NCR is : ","$" .code start: mov ax,@data mov ds,ax mov bx,n mov cx,r inc bx call ncr1 print msg mov ax,ncr call display mov ah,4ch int