summaryrefslogtreecommitdiffstats
path: root/printmsg.asm
diff options
context:
space:
mode:
Diffstat (limited to 'printmsg.asm')
-rw-r--r--printmsg.asm46
1 files changed, 17 insertions, 29 deletions
diff --git a/printmsg.asm b/printmsg.asm
index 4293877..f936856 100644
--- a/printmsg.asm
+++ b/printmsg.asm
@@ -36,20 +36,18 @@
* Print a message (pointer on the stack) on standard error, prefixed by
* "v9fs: "
* ------------------------------------------------------------------------- */
- .globl puterr
-puterr:
+GPROC(puterr)
printmsg "v9fs: "
/* Fall through */
- .size puterr,.-puterr
- .type puterr,@function
+END(puterr)
/* ------------------------------------------------------------------------- *
* puts
*
* Print a message (pointer on the stack) on standard error.
* ------------------------------------------------------------------------- */
- .globl puts
-puts:
+
+GPROC(puts)
pushaw
movw %sp,%bp
movw 18(%bp),%di
@@ -73,17 +71,15 @@ puts:
2:
popaw
retw $2
-
- .size puts,.-puts
- .type puts,@function
+END(puts)
/* ------------------------------------------------------------------------- *
* printnum
*
* Print an unsigned 32-bit integer on the stack
* ------------------------------------------------------------------------- */
- .globl printnum
-printnum:
+
+GPROC(printnum)
pushl %eax
pushl %edx
pushl %ecx
@@ -113,17 +109,15 @@ printnum:
popl %edx
popl %eax
retw $4
-
- .size printnum,.-printnum
- .type printnum,@function
+END(printnum)
/* ------------------------------------------------------------------------- *
* printhex4
*
* Print an hexadecimal 4-digit number from the stack
* ------------------------------------------------------------------------- */
- .globl printhex4
-printhex4:
+
+GPROC(printhex4)
pushw %ax
pushw %cx
pushw %dx
@@ -154,17 +148,15 @@ printhex4:
popw %cx
popw %ax
retw $2
-
- .size printhex4,.-printhex4
- .type printhex4,@function
+END(printhex4)
/* ------------------------------------------------------------------------- *
* printhex8
*
* Print an hexadecimal 8-digit number from the stack
* ------------------------------------------------------------------------- */
- .globl printhex8
-printhex8:
+
+GPROC(printhex8)
pushw %bp
movw %sp,%bp
pushw 6(%bp)
@@ -173,19 +165,15 @@ printhex8:
call printhex4
popw %bp
retw $4
-
- .size printhex8,.-printhex8
- .type printhex8,@function
+END(printhex8)
/* ------------------------------------------------------------------------- *
* crlf
*
* Print a newline
* ------------------------------------------------------------------------- */
- .globl crlf
-crlf:
+
+GPROC(crlf)
printmsg "\r\n"
retw
-
- .size crlf,.-crlf
- .type crlf,@function
+END(crlf)