Need help with assembler for PSP

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Need help with assembler for PSP

Post by ALgraFx »

Can anybody help me with study psp-as.exe from PSPDev?

I need dummy assembler source-code for PSP - something like this for x86 platform:

Code: Select all

	include	c:\asm\bin\inc\win.txt	;functions&constants
	.686
	.model	flat
;__________________________________________________________________
	.data
num	db	'0123456789',0
;__________________________________________________________________
	.code
_start:
	invoke	MessageBox,0,offset num,offset num,0
	invoke	ExitProcess,0
	end	_start
If MessageBox is hard to do in small source then let it be a function to draw 1 red pixel on the black screen.

Please make some comments inside sourcecode.

Also i need *.bat file with instruction how to compile and link this source to an *.PBP file - something like this for x86 platform:

Code: Select all

c:\asm\bin\ml.exe /c /coff /Cp C:\asm\work\work.asm
c:\asm\bin\Link.exe /SUBSYSTEM:WINDOWS /LIBPATH:c:\asm\bin\lib C:\asm\work\work.obj
P.S. I don't know С++ language (i'm coding only on assembler) and i don't use an make files at all. I need *.asm and *.bat files. Thank you and sorry for my English.
Mihawk
Posts: 29
Joined: Tue Apr 03, 2007 2:04 am

Post by Mihawk »

I think that comes the closest to what you want (if you want assembly only):
TyRaNiDs Minifire
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

Mihawk

Thank's, but it's not the thing i want!

I need *.asm and *.bat files. I don't wanna use an makefile.
Mihawk
Posts: 29
Joined: Tue Apr 03, 2007 2:04 am

Post by Mihawk »

Then why don't you look into the Makefile and put what it is doing into a bat file.
And if you really need asm files then just rename the main.S to main.asm ;P
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

I never worked with makefile so don't understand how to convert this file to *.bat format

Minifire is to complicate for startin' lear asm on PSP!

About *.s files i know - i've just prefer to work with *.asm extention.
Mihawk
Posts: 29
Joined: Tue Apr 03, 2007 2:04 am

Post by Mihawk »

Wha wha wha What, complicated?!
I mean did you really look into the file and at least tried to understand it? It's just 200 lines, half of which are comments o_O;
What part exactly is complicated about that?
Ask and it will be given to you; seek and you will find; knock and the door will be opened to you.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ALgraFx wrote:Mihawk

Thank's, but it's not the thing i want!

I need *.asm and *.bat files. I don't wanna use an makefile.
If you can't understand that example, you aren't ready to program assembly on the PSP. Sorry, but the PSP is complicated enough without then adding assembly on top of the issue. Go learn to be proficient in both C and assembly on the PC, then learn to be proficient in C on the PSP, then you'll find you don't have to ask these things about assembly on the PSP.

You aren't going to find .asm and .bat files for PSP programming, and no one will hold your hand long enough to get you through the basics of programming the PSP. You're supposed to already be proficient in programming before you try something like programming the PSP, at which point we just point you to the C sample code from the SDK.
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

Oh i see - if you can't help me why you are here?
If you can help then - help!

I can understand that example - i can't compile & link them coz i never used makefiles!

MessageBox sample needed for me to comfort studyin' asm on psp - i need see what i'm doing and see what's wrong!

My primary need is *.bat file to compile & link but if you can help me with sample source it be the full my need.

Also i'll be glad if someone give me link to psp-as.exe usage guide!

Long time ago then i started coding for pc (11 years ago) i have no information about how to compile project and how to make "Hello world!". I spend a lot of time to understand these 2 basical things. now i want eazy way to starting.

Make files i don't know coz at the begining i used *.bat files and now i use my own ide for asm coding. So i have no idea how to use makefiles - and don't want to!

if my english not bad i think you understand why i need these files.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ALgraFx wrote:Oh i see - if you can't help me why you are here?
If you can help then - help!

I can understand that example - i can't compile & link them coz i never used makefiles!

MessageBox sample needed for me to comfort studyin' asm on psp - i need see what i'm doing and see what's wrong!

My primary need is *.bat file to compile & link but if you can help me with sample source it be the full my need.

Also i be glad if someone give me link to psp-as.exe usage guide!
We're here to provide REAL help, not teach you how to do simple programming. This is a DEVELOPER site, not a student learning center.

There is no MessageBox on the PSP. You'll have to know how to do user interfaces from scratch before you start working on the PSP. Go learn about GUIs and such.

If you don't understand make files, go learn about gcc first on the PC. A thorough understanding of gcc is needed before you can do any PSP programming.

psp-as useage is the as ALL gcc as useage. Again, go learn gcc.

Well, I will give SOME help... here's the main gnu as useage link.
clicky
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

to J.F.

So u wanna say that i need not a REAL help?

I'm developer not student! I got a lot of experience in PC coding! Without help i can't find any info about asm on PSP and i need a "dummy" for firs step! Even if use minifire as "that dummy" i can't compile that.... anyway thanks for link - it better then nothing!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ALgraFx wrote:to J.F.

So u wanna say that i need not a REAL help?

I'm developer not student! I got a lot of experience in PC coding! Without help i can't find any info about asm on PSP and i need a "dummy" for firs step! Even if use minifire as "that dummy" i can't compile that.... anyway thanks for link - it better then nothing!
If you don't even know what a makefile is, you aren't a developer. Assembling an old win32 assembly "hello world" example doesn't make one a developer. If you were REALLY a developer, the asm example Mihawk pointed out would have been plenty. You wouldn't have had to ask about psp-as, either. You'd know that bringing up the man file was as simple as "man /usr/local/pspdev/man/man1/psp-as.1".

You have "experience" in "compiling" (your own words) the simplest of win32 examples if provided with a batch file to do all the work for you. I'd say that hardly qualifies you as a "developer".
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

Anyway this link helps me a lot.

OK i will change my question:

I got Minifire source, please, give me help "step by step" how to compile this source to *.PBP using makefile.

I mean give me a *.bat file which starting makefile to propper use. And if executing this makefile is not a last step then what to do next. it's all I need now.
Last edited by ALgraFx on Tue Aug 28, 2007 7:03 am, edited 2 times in total.
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

I got my own 3D software engine (it was made 9 year ago for dos),i got my own asm ide, i got a lot of "own need soft" - (i'm professional designer), i got my own ogl renderer...
My love to assembler starts from Speccy - it was long time ago - since these time i'm coding only at assembler. So i wanna coding for my psp and i want (with your help) an "fast-start". if you can't help me then i'm sorry for all my words before!
hlide
Posts: 739
Joined: Sun Sep 10, 2006 2:31 am

Post by hlide »

ALgraFx wrote:I got my own 3D software engine (it was made 9 year ago for dos),i got my own asm ide, i got a lot of "own need soft" - (i'm professional designer), i got my own ogl renderer...
My love to assembler starts from Speccy - it was long time ago - since these time i'm coding only at assembler. So i wanna coding for my psp and i want (with your help) an "fast-start". if you can't help me then i'm sorry for all my words before!

Anyway this link helps me a lot.
i suggest for you to be familiar with gcc and makefile even it is not for compiling C source. Because you would need psp-as (assembler) and psp-ld (linker)
but to be frank, you can also use psp-gcc to compile your assembly sources (.s or .S files)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

ALgraFx wrote:I got my own 3D software engine (it was made 9 year ago for dos),i got my own asm ide, i got a lot of "own need soft" - (i'm professional designer), i got my own ogl renderer...
My love to assembler starts from Speccy - it was long time ago - since these time i'm coding only at assembler. So i wanna coding for my psp and i want (with your help) an "fast-start". if you can't help me then i'm sorry for all my words before!
Okay, I apologize for the earlier remarks. There do seem to be a lot of people that show up here with no knowledge or experience and expect people here to show them every last step.

The first step to coding the PSP is examine the SDK sample code. It's C, not assembly, but it does teach you how the PSP works. That's the important thing. Once you learn how to get gcc for PSP running on your PC (linux or CygWin in Windows), then you can move from C to assembly.

You can get all the PSP stuff via subversion client (there are several for Windows, or just use svn for linux). Then command line in linux would be

Code: Select all

svn co svn://svn.ps2dev.org/psp/trunk psp
Inside that directory, you'll find pspsdk. Inside that you'll find the src drawer, and inside that the samples drawer. Inside that you'll find sample code and makefiles for all sorts of PSP functions - text, 3D, sound, file I/O, etc.
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

That's the .bat file i needed - thanks to all.

Code: Select all

psp-gcc -I. -Ic:/pspdev/psp/sdk/include -G0 -Wall -O0 -ggdb  -I. -Ic:/pspdev/psp/sdk/include -G0 -Wall -O0 -ggdb    -c -o main.o main.S 
psp-gcc -I. -Ic:/pspdev/psp/sdk/include -G0 -Wall -O0 -ggdb   -L. -Lc:/pspdev/psp/sdk/lib -nostartfiles  main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o main.elf 
mksfo 'Name' PARAM.SFO 
pack-pbp EBOOT.PBP PARAM.SFO null null null null null main.elf null 
del main.o 
del main.elf 
del PARAM.SFO 
pause
ALgraFx
Posts: 9
Joined: Tue Aug 28, 2007 12:08 am

Post by ALgraFx »

another one question about minifire

then i start EBOOT.PBP on 3.52m33 it work correct but on 3.71m33-* 3.80m33-* and 3.90m33-* (with instelled kernel 1.50) it show only black screen and exit.

that's not critical for me (i work on my project), but interesting why minifire don't work correctly on 3.71m33 (and higher)?

p.s. J.F. thanks for your "agression" in your posts - it gives me a real "boost" in PSP development!
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

He said "Okay, I apologize for the earlier remarks. "
does not work probably because of Sony NID changes since then
edit: or the syscalls as it uses the syscall addresses from 1.0 and 1.5
Image
Upgrade your PSP
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Expanding on that - if you have a Phat, you can run 1.5-based homebrew with the 1.5-add-on D_A made. I you are targeting Slim owners as well, you want to convert the app to user-mode 3.xx style. There are a few threads on that, and especially how to call kernel-mode functions from a user-mode 3.xx app. The main spot to start with that is here:
http://forums.ps2dev.org/viewtopic.php?p=58653#58653

Note - it's just a coincidence I started on my own post. ;) :D
Post Reply