diff options
author | JozanLeClerc <> | 2022-05-22 16:30:43 +0000 |
---|---|---|
committer | JozanLeClerc <> | 2022-05-22 16:30:43 +0000 |
commit | 6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4 (patch) | |
tree | b5b6815fba5abfb0cfab8c9c25c1d297f048e8d2 /src/c_example.S | |
parent | Update (diff) | |
download | asm-cgi-example-6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4.tar.gz asm-cgi-example-6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4.tar.bz2 asm-cgi-example-6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4.tar.xz asm-cgi-example-6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4.tar.zst asm-cgi-example-6c0655e7dfd83b726eeec71ecb72e29f5ef0a8d4.zip |
WIP
FossilOrigin-Name: 50c6fcb1c1758fb6252c48df702f81c626389bcc
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 |