* added compilers lcc and bcc (linux86)
[mascara-docs.git] / i86 / mtx / mtx / samples / LAB5.timer / USER / u2.s
blobfe4c13caca5fe44e0f76c9e663feeaa59a75906a
1 .globl begtext, begdata, begbss ! needed by linker
2 .globl _getc,_putc,_getcs
3 .globl _main, _syscall
5 .text ! these tell as:
6 begtext: ! text,data,bss segments
7 .data ! are all the same.
8 begdata:
9 .bss
10 begbss:
11 .text
13 call _main
15 dead: jmp dead
17 _getcs:
18 mov ax, cs
19 ret
21 !---------------------------------------------
22 ! char getc[] function: returns a char
23 !---------------------------------------------
24 _getc:
25 xorb ah,ah ! clear ah
26 int 0x16 ! call BIOS to get a char in AX
27 ret
29 !----------------------------------------------
30 ! void putc[char c] function: print a char
31 !----------------------------------------------
32 _putc:
33 push bp
34 mov bp,sp
36 movb al,4[bp] ! get the char into aL
37 movb ah,#14 ! aH = 14
38 mov bx,#0x000E ! bL = display page#
39 int 0x10 ! call BIOS to display the char
41 pop bp
42 ret
44 _syscall:
45 int 80
46 ret