0

Im running a Windows OS 64-bit i am trying to do a simple Helloworld Using NASM Shell Already had MingW Installed, its just that when the exe.file is executed it shows win32 exception, and .exe file has stopped working

Already tried to compile using nasm -f elf64 and gcc

Sample ASM File `

SECTION .data       
msg:    db "Hello World",10 
len:    equ $-msg       
                

    SECTION .text       
        global main     
main:               
    
    mov edx,len     
    mov ecx,msg     
    mov ebx,1       
    mov eax,4       
    int 0x80        
    
    mov ebx,0       
    mov eax,1       
    int 0x80        

`

Im just expecting a simple Hello World Using Assembly Language, already tried to install linux subservice for windows

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Developer
  • 1
  • 1
  • 1
    `Int 0x80` is a 32-bit Linux system call. You can't use that inside a 32-bit (or 64-bit) Native Windows program created in MinGW. If you assembled it and ran it in in a Linux based WSL2 session it would work. – Michael Petch Dec 14 '22 at 00:47
  • Essentially a duplicate of [Displaying text in command line after executing a .exe file from a compiled .asm file](https://stackoverflow.com/q/72611496) - see comments and its duplicate list. Except for the WSL part: `int 0x80` will work on WSL2. – Peter Cordes Dec 14 '22 at 04:06

0 Answers0