Search Results

Search found 12 results on 1 pages for 'masm32'.

Page 1/1 | 1 

  • Why is my masm32 program crashing whenever I try using interrupts?

    - by incrediman
    Here's the code: .386 ;target for maximum compatibility .model small,stdcall ;model .code main: int 20h END main Result: http://img705.imageshack.us/img705/3738/resultom.png "test.exe has stopped working" - always right when it reaches the interrupt. This is the interrupt I'm trying to use. It should simply exit the program. Others I've tried include character input/output, etc.. Nothing works. I'm on windows 7, using masm32 with the WinAsm IDE. There are so many cool things it seems I should be able to do with interrupts... however, it crashes whenever I try to use an interrupt - always the same way. This seems related and possibly useful: http://stackoverflow.com/questions/1414260/dos-interrupt-in-masm-x86-assembly-crashing ...but I haven't really been able to figure anything out from it. Any suggestions?

    Read the article

  • MASM StrCmp Undefined?

    - by Yvan JANSSENS
    Hi, If I try to assemble the following code, I get a A2006 error ( error A2006: undefined symbol : StrCmp). Here's my code: .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\masm32.inc include \masm32\include\user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\stdlib.lib includelib \masm32\lib\user32.lib .data YvanSoftware db "(c) YvanSoftware - ALL RIGHTS RESERVED", 13 ,10 ,0 EnterYourName db "Please enter your name: ", 0 CRLF db 13,10,0 TheHolyMan db "Yvan", 0 Seriously db "Seriously? You're the MAN!", 13,10,0 LoserName db "What a loser name.", 13,10 .data? buffer db 100 dup(?) .code start: invoke StdOut,addr YvanSoftware invoke StdOut, addr EnterYourName invoke StdIn, addr buffer, 100 invoke StdOut, addr CRLF invoke StrCmp,addr buffer, addr TheHolyMan ;error fires here je HolyMan IfNotHolyMan: invoke StdOut, addr LoserName jmp EndIfHolyMan HolyMan: invoke StdOut, addr Seriously jmp EndIfHolyMan EndIfHolyMan: invoke ExitProcess,0 END start I'm a complete n00b at assembler, and I'm trying to learn it. ;) Yvan

    Read the article

  • Compile Assembly Output generated by VC++?

    - by SDD
    I have a simple hello world C program and compile it with /FA. As a consequence, the compiler also generates the corresponding assembly listing. Now I want to use masm/link to assemble an executable from the generated .asm listing. The following command line yields 3 linker errors: \masm32\bin\ml /I"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include" /c /coff asm_test.asm \masm32\bin\link /SUBSYSTEM:CONSOLE /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" asm_test.obj indicating that the C-runtime functions were not linked to the object files produced earlier: asm_test.obj : error LNK2001: unresolved external symbol @__security_check_cookie@4 asm_test.obj : error LNK2001: unresolved external symbol _printf LINK : error LNK2001: unresolved external symbol _wmainCRTStartup asm_test.exe : fatal error LNK1120: 3 unresolved externals Here is the generated assembly listing ; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.30729.01 TITLE c:\asm_test\asm_test\asm_test.cpp .686P .XMM include listing.inc .model flat INCLUDELIB OLDNAMES PUBLIC ??_C@_0O@OBPALAEI@hello?5world?$CB?6?$AA@ ; `string' EXTRN @__security_check_cookie@4:PROC EXTRN _printf:PROC ; COMDAT ??_C@_0O@OBPALAEI@hello?5world?$CB?6?$AA@ CONST SEGMENT ??_C@_0O@OBPALAEI@hello?5world?$CB?6?$AA@ DB 'hello world!', 0aH, 00H ; `string' CONST ENDS PUBLIC _wmain ; Function compile flags: /Ogtpy ; COMDAT _wmain _TEXT SEGMENT _argc$ = 8 ; size = 4 _argv$ = 12 ; size = 4 _wmain PROC ; COMDAT ; File c:\users\octon\desktop\asm_test\asm_test\asm_test.cpp ; Line 21 push OFFSET ??_C@_0O@OBPALAEI@hello?5world?$CB?6?$AA@ call _printf add esp, 4 ; Line 22 xor eax, eax ; Line 23 ret 0 _wmain ENDP _TEXT ENDS END I am using the latest masm32 version (6.14.8444).

    Read the article

  • High level macro not recognized - Beginner MASM

    - by Francisco P.
    main proc finit .while ang < 91 invoke func, ang fstp res print real8$(ang), 13, 10 print real8$(res), 13, 10 fld ang fld1 fadd fstp ang .endw ret main endp What's wrong with this piece of MASM code? I get an error on .endw. I have ran some tests to ensure myself of that. Assembler tells me invalid instruction operands. Thank you for your time!

    Read the article

  • Working with QWords

    - by Glenn1234
    I'm learning and in the course of that working on an assembler conversion which uses QWORDs a lot (x86-32bit). Now my reference material doesn't have anything on working with such values beyond the obvious of splitting them up into the 32-bit registers. I guess they're on the old side. The newer processors have mmx and sse instructions and the like. Would I be served well to look into those instructions for solving this? What is the best way to handle doing work on QWORD values?

    Read the article

  • First ASM program

    - by Tal
    Hello, I'm trying to run my first ASM 8086 program on MASM on Windows Vista 64bit OS. I put this program on my MASM editor: .model small .stack .data message db "Hello world, I'm learning Assembly !!!", "$" .code main proc mov ax,seg message mov ds,ax mov ah,09 lea dx,message int 21h mov ax,4c00h int 21h main endp end main and the MASM editor gives me this output that I got no idea what's wrong with the program: Assembling: D:\masm32\First.asm D:\masm32\First.asm(9) : error A2004: symbol type conflict D:\masm32\First.asm(19) : warning A4023: with /coff switch, leading underscore required for start address : main _ Assembly Error Where is the problem with this code? This is my first ASM program please remember. Thank you :)

    Read the article

  • unable to copy file to folder, permission denied without explanation

    - by ValekHalfHeart
    Recently Norton Internet security deleted ml.exe (an assembler I use to program in masm32) off of my computer, thinking that one of the programs I had written with it was a virus (it was most certainly not). Fortunately, I had a copy of ml.exe backed up in an external hard drive, and tried to copy it over to my computer. The old ml.exe was located in C:\masm32\bin, so I tried to copy the new one to that location. After disabling Norton (which had opened the folder and preventing me from accessing it), I am still unable to copy the new file to C:\masm32\bin. When I tried, Windows announced that I would need Administrator permission to copy the file. Since I'm an admin, I figured this wouldn't be a problem although it was unexpected, as I have never had to provide administrator permission to access this folder before. However, instead of prompting me to enter my password, Windows simply refuses to copy the file: I repeat, I was not asked to provide a password. It simply says that I do not have permission. Does anyone know what's happening and how to fix it? Is Norton still causing problems, or it something else?

    Read the article

  • Overcoming the 1024 character limit with setx

    - by Madhur Ahuja
    I am trying to set environment variables using the setx command, such as follows setx PATH "f:\common tools\git\bin;f:\common tools\python\app;f:\common tools\python\app\scripts;f:\common tools\ruby\bin;f:\masm32\bin;F:\Borland\BCC55\Bin;%PATH%" However, I get the following error if the value is more then 1024 characters long: WARNING: The data being saved is truncated to 1024 characters. SUCCESS: Specified value was saved. But some of the paths in the end are not saved in variable, I guess due to character limit as the error suggests.

    Read the article

  • Should I learn C?

    - by Justin Standard
    Original Question: Should I Learn C? In the theme of the stackoverflow podcast, here's a fun question: should I learn C? I expect Jeff & Joel will have something to say on this. Some info on my background: Primarily a Java programmer on "enterprisy" systems. Favorite languages: python, scheme 7 years programming experience A very small amount of C++ experience, practically no C experience No immediate "need" to learn C So should I learn C? If so, why? If not, why? C or Assembly? Lots of folks recomending Assembler, so add on question: Is it better to learn C or Assembler? If Assembler, which one? Recommended assemblers so far: Motorolla 68000 Intel Assembler (does he mean x86?) MASM32

    Read the article

  • Calling managed code from unmanaged win32 assembly dll - crash

    - by JustGreg
    I'm developing a serial port dll in win32 assembly (MASM32). It has its own thread checking multiple events and at a specified buffer treshold it'd notify the managed main application by calling a callback function. It just a call with no arguments/return value. At startup the main application stores the callback function's address by calling a function in the dll: pCallBackFunction dd 0 SetCallBackPointer proc pcb:DWORD mov eax, pcb mov pCallBackFunction, eax call DWORD ptr pCallBackFunction ; verify it immediately ret SetCallBackPointer endp The upper function immediately calls back the managed application callback routine for verification purposes. It is working fine. However, when I place the call instruction to other functions in the dll it crashes the application. It doesn't matter if the call is in a simple function or in the threadproc of the dll. For example: OpenPort proc pn:byte,br:dword, inputbuffersize: dword, outputbuffersize:dword, tresholdsize: dword LOCAL dcb: DCB LOCAL SerialTimeOuts: COMMTIMEOUTS call DWORD ptr pCallBackFunction xor eax, eax mov al, pn mov [com_port+3],al etc. etc. will crash at call DWORD ptr pCallBackFunction always. Since I call SetCallBackPointer first to store a valid address in pCallBackFunction, it should have a valid address. My managed app is written in C# and the relevant part is: public partial class Form1 : Form { public delegate void CallBackDelegate(); public static CallBackDelegate mydelegate; [DllImport("serialport.dll")] private static extern void SetCallBackPointer(CallBackDelegate Delegate); [DllImport("serialport.dll")] public static extern int OpenPort(byte com, uint br, uint inbufsize, uint outbufsize, uint treshsize); public Form1() { InitializeComponent(); mydelegate =new CallBackDelegate(CallbackFunction); SetCallBackPointer(mydelegate); unsafe { int sysstat; int hResult; hResult = OpenPort(Convert.ToByte('5'), 9600, 306, 4, 4); } } public static void CallbackFunction() { MessageBox.Show( "CallBack Function Called by Windows DLL"); } The VS debugger reported that the dll had tried to read/write from/to a protected memory address. But when calling SetCallBackPointer there is no such problem. What am I doing wrong here? Any tips would be great!

    Read the article

  • GDI+ & Delphi, PNG resource, DrawImage, ColorConversion -> Out of Memory

    - by Paul
    I have started to toy around with GDI+ in Delphi 2009. Among the things that I wanted to do was to load a PNG resource and apply a Color Conversion to it when drawing it to the Graphics object. I am using the code provided in http://www.bilsen.com/gdiplus/. To do that I just added a new constructor to TGPBitmap that uses the same code found in <www.codeproject.com>/KB/GDI-plus/cgdiplusbitmap.aspx (C++) or <www.masm32.com>/board/index.php?topic=10191.0 (MASM) converted to Delphi. For reference, the converted code is as follows: constructor TGPBitmap.Create(const Instance: HInst; const PngName: String; dummy : PngResource_t); const cPngType : string = 'PNG'; var hResource : HRSRC; imageSize : DWORD; pResourceData : Pointer; hBuffer : HGLOBAL; pBuffer : Pointer; pStream : IStream; begin inherited Create; hResource := FindResource(Instance, PWideChar(PngName), PWideChar(cPngType)); if hResource = 0 then Exit; imageSize := SizeofResource(Instance, hResource); if imageSize = 0 then Exit; pResourceData := LockResource(LoadResource(Instance, hResource)); if pResourceData = nil then Exit; hBuffer := GlobalAlloc(GMEM_MOVEABLE, imageSize); if hBuffer <> 0 then begin try pBuffer := GlobalLock(hBuffer); if pBuffer <> nil then begin try CopyMemory(pBuffer, pResourceData, imageSize); if CreateStreamOnHGlobal(hBuffer, FALSE, pStream) = S_OK then begin GdipCheck(GdipCreateBitmapFromStream(pStream, FNativeHandle)); end; finally GlobalUnlock(hBuffer); pStream := nil; end; end; finally GlobalFree(hBuffer); end; end; end; The code seems to work fine as I am able to draw the loaded image without any problems. However, if I try to apply a Color Conversion when drawing it, then I get a lovely error: (GDI+ Error) Out of Memory. If I load the bitmap from a file, or if I create a temporary to which I draw the initial bitmap and then use the temporary, then it works just fine. What bugs me is that if I take the C++ project from codeproject, add the same PNG as resource and use the same color conversion (in other words, do the exact same thing I am doing in Delphi in the same order and with the same function calls that happen to go to the same DLL), then it works. The C++ code looks like this: const Gdiplus::ColorMatrix cTrMatrix = { { {1.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.5, 0.0}, {0.0, 0.0, 0.0, 0.0, 1.0} } }; Gdiplus::ImageAttributes imgAttrs; imgAttrs.SetColorMatrix(&cTrMatrix, Gdiplus::ColorMatrixFlagsDefault, Gdiplus::ColorAdjustTypeBitmap); graphics.DrawImage(*pBitmap, Gdiplus::Rect(0, 0, pBitmap->m_pBitmap->GetWidth(), pBitmap->m_pBitmap->GetHeight()), 0, 0, pBitmap->m_pBitmap->GetWidth(), pBitmap->m_pBitmap->GetHeight(), Gdiplus::UnitPixel, &imgAttrs); The Delphi counterpart is: const cTrMatrix: TGPColorMatrix = ( M: ((1.0, 0.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 0.0, 0.5, 0.0), (0.0, 0.0, 0.0, 0.0, 1.0))); var lImgAttrTr : IGPImageAttributes; lBitmap : IGPBitmap; begin // ... lImgAttrTr := TGPImageAttributes.Create; lImgAttrTr.SetColorMatrix(cTrMatrix, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap); aGraphics.DrawImage ( lBitmap, TGPRect.Create ( 0, 0, lBitmap.Width, lBitmap.Height ), 0, 0, lBitmap.Width, lBitmap.Height, UnitPixel, lImgAttrTr ); I am completely clueless as to what may be causing the issue, and Google has not been of any help. Any ideas, comments and explanations are highly appreciated.

    Read the article

1