Fasmarm


Yes i do, i mostly am porting my OS to the GP2x, but have also done some stuff that run on the GP2x linux, using FasmArm.
 
coz my english is not good i need some tuts for this.
i programmed in asm deep in ZX Spectrum era :)
i found your thread about fasmarm but i have same result. only blank screen then return to menu. i found one example for gp2x but didnt work :(
can you post me little example such as "hello world"?
And where i get info about SWI calls ?
thanks a lot.

oops here is code

CODE

format ELF executable
entry start
segment executable readable

start:
;print message
mov r0,1;stdout
add r1,pc,msg-$-8;msg
mov r2,msg_len;length
swi 0x900004;__NR_write (syscall)

;cd /usr/gp2x
add r0,pc,mnudir-$-8
swi 0x90000c;__NR_chdir (syscall )

;execute gp2xmenu
add r0,pc,mnuexe-$-8
mov r1,0;arg2 = NULL
mov r2,0;arg3 = NULL
swi 0x90000b;__NR_execve (syscall execve)

;exit
mov r0,1;return value
swi 0x900001;__NR_exit (syscall exit)

msg: db 'Hello World in ARM assembler',10
msg_len = $ - msg
mnudir: db '/usr/gp2x'
mnuexe: db '/usr/gp2x/gp2xmenu'


segment writeable;dummy segment for bss
 
spooky2x said:
coz my english is not good i need some tuts for this.
i programmed in asm deep in ZX Spectrum era :)
i found your thread about fasmarm but i have same result. only blank screen then return to menu. i found one example for gp2x but didnt work :(
can you post me little example such as "hello world"?
And where i get info about SWI calls ?
thanks a lot.

oops here is code

CODE

format ELF executable
entry start
segment executable readable

start:
;print message
mov r0,1;stdout
add r1,pc,msg-$-8;msg
mov r2,msg_len;length
swi 0x900004;__NR_write (syscall)

;cd /usr/gp2x
add r0,pc,mnudir-$-8
swi 0x90000c;__NR_chdir (syscall )

;execute gp2xmenu
add r0,pc,mnuexe-$-8
mov r1,0;arg2 = NULL
mov r2,0;arg3 = NULL
swi 0x90000b;__NR_execve (syscall execve)

;exit
mov r0,1;return value
swi 0x900001;__NR_exit (syscall exit)

msg: db 'Hello World in ARM assembler',10
msg_len = $ - msg
mnudir: db '/usr/gp2x'
mnuexe: db '/usr/gp2x/gp2xmenu'
segment writeable;dummy segment for bss





Sure i will write some stuff and try to post them later to night, But note one thing, that Print SWI will print to standard out put, which in the gp2x case, you will need a bob and PC to see it.
 
Last edited by a moderator:
Back
Top