is that x86?
Since this was requested, I'll make a little "hello world" program in assembler. Note that it's designed for Nasm. Different compilers have subtle differences in syntax.
Code:SEGMENT .data message db "Hello world." # our message db 0Ah db 0Dh # return carriage and line feed SEGMENT .text mov eax,04h # eax = 4 for system call to write to file mov ebx,01h # file descriptor, in this case 1 for stdout mov ecx,message # address of message mov edx,0Eh # number of bytes long int 080h # call linux mov eax,0h # system call to exit int 080h
Yes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.
Z80, aye? Now that brings back distant memories ... ;DYes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.
Here's the same in MIPS assembly:
Code:* .text * .globl __start __start: * la * $a0, hello * li * $v0, 4 * syscall * li * $v0, 10 * syscall * .data hello: * .asciiz "Hello World!\n"
how could i have missed that on your resumeYes, of course. I only know the x86 and z80 processors and it's definitely not z80 code.
pretty cool man.
So you guys have any questions or want any other examples? This one only uses two commands and is kind of dull.
Where is there a good tutorial on writing assembly for x86 platforms?
sure - how about moving "Hello World" out through the UART.
I don't know, maybe I am just a dumb goof, but that looks incredibly hard for such a simple proggy. I need to learn assembly, but it is such a different way of thinking than I am used to...from the looks of it it is obviously going to take a lot of time...So you guys have any questions or want any other examples? This one only uses two commands and is kind of dull.
Aragorn
Bookmarks