diff options
Diffstat (limited to 'src/c_example.S')
-rw-r--r-- | src/c_example.S | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/c_example.S b/src/c_example.S index 17b2f34..652f688 100644 --- a/src/c_example.S +++ b/src/c_example.S @@ -39,12 +39,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * asm-cgi-example: src/c_example.S - * Sun May 22 16:51:38 CEST 2022 + * Sun May 22 17:17:07 CEST 2022 * Joe */ .text .extern c_cpu +.extern c_infos .globl main main: @@ -59,12 +60,21 @@ write_begin: movb $0x4, %al /* SYS_write */ syscall +infos: + callq c_infos + cpu: - callq c_cpu + xorq %rdi, %rdi + xorq %rax, %rax + movb $0x1, %dil + movq $str_h2cpu, %rsi + movq $len_h2cpu, %rdx + movb $0x4, %al /* SYS_write */ + syscall + # callq c_cpu write_end: xorq %rdi, %rdi - xorq %rsi, %rsi xorq %rax, %rax movb $0x1, %dil movq $str_end, %rsi @@ -77,7 +87,9 @@ end: retq .data - str_begin: .ascii "Content-type: text/html\n\n<html>\n\t<head>\n\t\t<title>Title</title>\n\t</head>\n\t<body>\n\t\t<h1>asm-cgi-example</h1>\n\t\t<p>\n\t\t\tThis page was generated by a small assembly program. It will run some shell commands for you. It's pointless in essence but I am trying to prove a point.\n\t\t</p>\n\t\t<h2>Some CPU infos</h2>\n\t\t<p>\n\t\t\tLet's fetch some infos about this server's CPU.\n\t\t</p>\n" + str_begin: .ascii "Content-type: text/html\n\n<html>\n\t<head>\n\t\t<title>Title</title>\n\t</head>\n\t<body>\n\t\t<h1>asm-cgi-example</h1>\n\t\t<p>\n\t\t\tThis page was generated by a small assembly program. It will run some shell commands for you. It's pointless in essence but I am trying to prove a point.\n\t\t</p>\n\t\t<h2>General infos</h2>\n\t\t<p>\n\t\t\tLet's fetch some general informations first.\n\t\t</p>\n" len_begin = . - str_begin + str_h2cpu: .ascii "\t\t<h2>Some CPU infos</h2>\n\t\t<p>\n\t\t\tNow let's fetch some infos about this server's CPU.\n\t\t</p>\n" + len_h2cpu = . - str_h2cpu str_end: .ascii "\t</body>\n</html>\n" len_end = . - str_end |