Jump to content

Anyone know what kind of Assembly this is?

- - - - -

  • Please log in to reply
1 reply to this topic

#1
DarkLordoftheMonkeys

DarkLordoftheMonkeys

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 255 posts
I got this code when I compiled a simple C program and stopped it before it compiled the Assembly into an executable:


	.cstring

	.align 2

LC0:

	.ascii "Hello world"

	.text

.globl _main

_main:

	pushl	%ebp

	movl	%esp, %ebp

	pushl	%ebx

	subl	$20, %esp

	call	L3

"L00000000001$pb":

L3:

	popl	%ebx

	leal	LC0-"L00000000001$pb"(%ebx), %eax

	movl	%eax, (%esp)

	call	L_printf$stub

	movl	$0, %eax

	addl	$20, %esp

	popl	%ebx

	leave

	ret

	.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5

L_printf$stub:

	.indirect_symbol _printf

	hlt ; hlt ; hlt ; hlt ; hlt

	.subsections_via_symbols


I'm trying to figure out what kind of assembly language I can use to program my MacBook.
Life's too short to be cool. Be a nerd.

#2
JewFro297

JewFro297

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 224 posts
It looks like it's x86 code, 32 bit in at&t syntax. If your mac has an intel processor, then you program it with x86. It probably supports x86_64 also.

If your mac is a PowerPC, you need to use their assembly language. Judging by the code you gave us, if you can run that on your mac computer then you have an intel processor and can use x86.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users