File: libcdemo.asm

package info (click to toggle)
fasm 1.73.34-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,540 kB
  • sloc: pascal: 4,300; asm: 3,056; makefile: 12
file content (26 lines) | stat: -rw-r--r-- 402 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

; fasm example of using the C library in Unix systems

; compile the source with commands like:
;   fasm libcdemo.asm libcdemo.o
;   gcc libcdemo.o -o libcdemo
;   strip libcdemo

format ELF

include 'ccall.inc'

section '.text' executable

 public main
 extrn printf
 extrn getpid

 main:
	call	getpid
	ccall	printf, msg,eax
	ret

section '.data' writeable

 msg db "Current process ID is %d.",0xA,0