You are not logged in.


exec

Neuer Clubber

  • "exec" started this thread

Posts: 5

Location: Chile

Occupation: Schüler

  • Send private message

1

Friday, December 7th 2007, 8:26pm

Assembler tutorials für Linux ??

Hallo hab ein paar fragen zur assembly unter Linux... ist es schwerer asm unter linux als unter Windows zu lernen ?? und kennt ihr gute bücher oder tutorials zum thema Assembly unter Linux ???ß

MfG

exec

Rolf

Moderatorenleitung

Posts: 932

Location: Tessin (Schweiz)

Occupation: *

  • Send private message

2

Friday, December 7th 2007, 9:53pm

Hallo

als Einstieg empfehle ich das Tutorial von Dr. Paul Carter. Gibt es da auch in deutscher Uebersetzung.

Gruss Rolf
Wenn Du entdeckst, dass Du ein totes Pferd reitest, steig ab. Weisheit der Dakota Indianer

exec

Neuer Clubber

  • "exec" started this thread

Posts: 5

Location: Chile

Occupation: Schüler

  • Send private message

3

Monday, December 10th 2007, 11:31am

Uff danke das hatte ich.. aber da wird nicht so viel on AT&T syntax gesprochen..... zum compilieren verwende ich NASM... und eine frage hab ich noch.,. ich versuche ein "hello world" in Intel zu schreiben.. ( Intel assembly ) geht aber nicht.. daher hab ich den syntax für linux gesucht und bin auf AT&R Assembly gekommen.. das ist aber schwerer als intel :D also.. wisst ihr vielleicht wie man INTEL Assemble in linux schreiben kann ??

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
section .text 	 	 		; Declara la seccion
global _start 				; start para el ELF-Linker/Loader
_start: 				; Start del programa
	mov 	edx,len 		; argumento 3, cuan largo es el texto
	mov 	ecx,msg 		; segundo argumento, Direccion del texto en memoria ?
	mov 	ebx,1 	   		; Primer argumento, file handle stdout
	mov 	eax,4 			; Llamada al systema Nr.4 = sys_write
	int 	0x80 			; llamando al kernel con arriba escritos parametros de 	 
			                ;llamada al systema
	mov 	ebx,0 			; Primer argumento para sys_exit (termina el programa)
	mov 	eax,1 			; LLamada al sistema Nr.1 (sys_exit) Termino del programa
	int 	0x80 			; llamando al kernel con arriba escritos parametros de
                                        ; LLamada al sistema
section .data 				; Declara seccion
msg 	db 	'Hello world',0x0A 	; Nustro texto incluido  Lineas LF (0x0A) <-no bien traducido
len 	equ 	$ - msg 		; calcular Largo del texto  (12 Bytes)


das da oben ist AT&T syntax... ist mir aber zu schwer.. und das hier unten ist INTEL :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.model tiny                 ;pequenio programa
 .code                       ;empieza el codigo
 org 100h                    ;creamos un COM <---- DOS ??

 START:                      ;Label start

  mov ah, 09h                ;09h es la INT21h funcion para mostrar texto ?? <-- DOS ?? 
  mov dx, offset HelloWorld  ;Donde esta el texto...
  INT 21h                    ;Lo escribe!

 ENDE:                       ;Label ende 
  
  mov ah,4ch                 ;4Ch para terminar
  INT 21h                    ;Termina !

 HelloWorld db 'Hello World !!',10d,13d,'$'   ;el string..
 
 END START                   ;termina todo ??..


PS: Sorry hatte noch keine zeit und auf deutsch zu übersetzen.. aber ich hoffe der Code ist zu verstehen :D

ich will in linux INTEL ASsembly schreiben... hilf mir bitte :D

Rolf

Moderatorenleitung

Posts: 932

Location: Tessin (Schweiz)

Occupation: *

  • Send private message

4

Monday, December 10th 2007, 7:34pm

Hallo

Dein erstes Beispiel ist das was Du suchst. Das zweite Beispiel ist für Dos und *.com.

Uebersetzen und linken von hello.asm kannst Du mit

Source code

1
2
nasm -f elf hello.asm
ld -s -o hello hello.o
hier ist noch ein Tutorial -> http://www.lcs-chemie.de/assemb.htm.

Gruss Rolf
Wenn Du entdeckst, dass Du ein totes Pferd reitest, steig ab. Weisheit der Dakota Indianer

Rate this thread