Difference between revisions of "CSC231 skel.asm"

From dftwiki3
Jump to: navigation, search
(New page: <code><pre> ;;; program_name.asm ;;; your name ;;; ;;; a description of the program ;;; ;;; to assemble and run: ;;; ;;; nasm -f elf -F stabs program.asm ;;; ld -o program progra...)
 
Line 1: Line 1:
<code><pre>
+
--[[User:Thiebaut|D. Thiebaut]] 19:56, 7 September 2010 (UTC)
 +
----
 +
<source lang="asm">
 
;;; program_name.asm
 
;;; program_name.asm
 
;;; your name
 
;;; your name
Line 46: Line 48:
 
int 0x80 ; final system call
 
int 0x80 ; final system call
  
</pre></code>
+
</source>
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
<br />
 +
[[Category:CSC231]]

Revision as of 15:56, 7 September 2010

--D. Thiebaut 19:56, 7 September 2010 (UTC)


;;; program_name.asm
;;; your name
;;; 
;;; a description of the program
;;;
;;; to assemble and run:
;;;
;;;     nasm -f elf -F  stabs program.asm
;;;     ld -o program program.o
;;;     ./program
;;; -------------------------------------------------------------------

;%include files here...

EXIT    equ             1
WRITE   equ             4
STDOUT  equ             1
        
      	;; ------------------------------------------------------------
	;; data areas
	;; ------------------------------------------------------------

	section	.data

        
	;; ------------------------------------------------------------
	;; code area
	;; ------------------------------------------------------------

	section	.text
	global	_start

_start:


        ;; (add your code here!!!!)
        

        

	;; exit()

	mov	eax,EXIT
	mov	ebx,0
	int	0x80		; final system call