Kengo Kinoshita
|
May I ask to use assembly language for implement the memory check module.
|
Kengo Kinoshita
08/21/2010 8:43 AM
post63856
|
May I ask to use assembly language for implement the memory check module.
May I ask to use assembly language for implement the memory check module.
So I already try to simulate that environment of MINGW on Windows XP,
And next step, Start to write assembly code for QNX6.4.0.
So Please see following sample code,
And Now have not understanding that use the software interrupt for output to stdio.
Please let me know how to output to stdio on assembly environment.
Regards,
Kengo Kinoshita.
--Sample code --
.file "main.s"
.data
msg: .ascii "hello world\n"
msgend: .equ len, msgend - msg
.global main
main:
movl $??, %eax # write system call(sys_write)
movl $??, %ebx #output to stdout
movl $msg, %ecx
movl $len, %edx
int $????
ret
--Linux case--
.file "main.s"
.data
msg: .ascii "hello world\n"
msgend: .equ len, msgend - msg
.global main
main:
movl $4, %eax # write system call(sys_write)
movl $1, %ebx # output to stdout
movl $msg, %ecx
movl $len, %edx
int $0x80
ret
|
|
|