Assembly language Hello World not working
Hi,
I have been using the SASM assembly language editor for a couple of days now and I've found a number of programs on the net to display a Hello World message. I have tried a number of these and none of them output anything at all. Below is an example of the code I've found : .intel_syntax noprefix .bss .data msg: .asciz "Hello, world!\n\r" .equ len, 15 .text .global _start _start: push rbp mov ebp,esp mov edx,len mov ecx,msg mov ebx,1 mov eax,4 int 0x80 pop rbp mov eax,1 int 0x80 .end Another thing I want is to output all files, source, object files and so on to the same folder when assembling. How do I do this, because when the object file is assembled it outputs to the folder /tmp/SASM and not my folder ? Thanks FC. |
here is a show me
Hello, world! SASM: The Simple Assembler Reference Manual In care of google. ;) that is all I know about it , sorry :( |
Sorted
Hi,
After much hair pulling concerning this problem I thought I would try the NASM assembler instead of the GCC assembler and the programs work, albeit with a little bit of tweaking. So I will continue using NASM when writing assembly language coding in Linux. FC. |
Quote:
pls - mark solved. cheers! :hattip: |
For 64 bit, you might want syscall, instead of int 0x80.
Code:
movq $1, %rax # syscall: write. |
You don't really need an OS, just <446 bytes in the boot sector :D
https://www.google.com/search?q=bios+hello+world Wiki is your friend! Now, that's what I'd enjoy doing :eek: |
Quote:
|
All times are GMT -5. The time now is 03:55 PM. |