Computer-Ag am WvS Blog der Computer-AG am Werner von Siemens Gymnasium Berlin

4. März 2011

4.3.2011

Filed under: Allgemein — admin @ 16:25

Niklas lernt wieder C bei Angelo.Tristan schaut zu. Nikolas kommt auch noch vorbei. Julian werkelt weiter an C-tris. Moritz war auch kurz vorher da und kommt nach der neunten Stunde noch einmal vorbei.

Robert lernt auch ein bisschen Assembly:

section	.text
    global _start			;must be declared for linker (ld)

_add:
	mov	dword eax, [esp + 4]
	add	dword	eax, [esp + 8]
	ret

_start:					;tell linker entry point

	push 	dword 	4
	push 	dword	6
	call 	_add
	add 	esp, 8
	mov  	edx, eax
	mov	ecx,msg	;message to write
	mov	ebx,1	;file descriptor (stdout)
	mov	eax,4	;system call number (sys_write)
	int	0x80	;call kernel

	mov	eax,1	;system call number (sys_exit)
	int	0x80	;call kernel

section	.data

msg	db	'Hello, world!',0xa	;our dear string
;len	equ	$ - msg			;length of our dear string

Nächste Woche ist Dienstag und Freitag AG.

Keine Kommentare »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment