can sombody make a hello world tutorial for BRASS

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

can sombody make a hello world tutorial for BRASS

Post by necro »

I am having trouble with all asm efforts and am looking to just be able to get something to compile. (in any compiler for any emu/real calc) so if I could get something very, very specific to, say for instance, just display hello world in brass/latenite, Id be most happy.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

  • Run Latenite.
  • Select TI-8x Program, and type "Hello" in the name field. Click 'Create New Project'.
  • Double-click 'Program.asm' on the right hand side. This will open up the source file for editing.
Now, as an aside, Latenite sets up a project in a different way to the way most tutorials set up projects. What happens is that the assemblers starts by assembling Includes\Headers.asm first, which sets up all the program header and shell information for you, before assembling Program.asm which contains your code. I did this as it feels (at least, to me) a lot neater.

The program will start at the "Main" label, regardless of shell options. So, your code should come after Main. The 'ret' returns back to the shell afterwards, ending program execution.

Modify the code so that it looks like this:

Code: Select all

; ===============================================================
; Hello
; ===============================================================

.module Program
.export

	Main
		; Program entry point
		

		xor a
		ld (curCol),a
		ld (curRow),a
		
		ld hl,HelloString
		bcall(_PutS)
		
		bcall(_GetKey)		
		
		ret
		
	
	HelloString
	.db "Hello, world!", 0
	
.endmodule
Here's a tip - when you type "bcall(_", press Ctrl+Space afterwards and a pop-up window will appear listing all loaded labels (from XML help files) that start with "_".

Hit F6 and the following should appear (it gets faster after you've run Brass for the first time):

Code: Select all

------ Building: Source File: Headers.asm, Script: TI-83 Plus (Ion).cmd ------
Brass Z80 Assembler 1.0.4.7 - Ben Ryves 2005-2006
-------------------------------------------------
Assembling...
Pass 1 complete. (81ms).
Pass 2 complete. (29ms).
Writing output file...
Warning: The TIOS gets confused with variable names containing lowercase characters ('Hello').
Errors: 0, Warnings: 1.
Writing error log...
Writing debug log...
Writing list file...
Done!
------ Build Process Complete ------
========== Build: 0 errors, 1 warning ==========
This is complaining that the program name, "Hello", is not TIOS-friendly. To change this, click File->Project Properties, and change Binary Name to "HELLO" (without quotes).

If you expand the Bin folder, you should now see "Hello - TI-83 Plus (Ion).8xp" which would run under Ion on your calculator.

To run the program in PTI easily, press F5. You must have an 83+ ROM renamed to ti8x.rom - located at Debug\PindurTI\ROMs\ti8x.rom - to run this, though.

Let me know how you get on!
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

Ok, I have tried your example in as many ways as I can think of but all I get is a screen flash (mirage) or nothing but a "done" line in nostub.

It should be noted I tired a number of other things but they all also failed.
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

well, while I got tasm to finaly work (ergggg...about time) , I still can't get latenite...eh, oh well. I should be able to get buy.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Very strange. Does it work on hardware? Could you send me a copy of the output .8xp? (Or just zip up the project file?)
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

sure...can I get an email adress? I can't figure out why programs I compile with it don't seem to work even though they ressble tasm compiled programs I have gottent to work. out of couriosisty, why inst there a straight build option where the headers and all are just the same way that tasm does it?
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

necro wrote:sure...can I get an email adress? I can't figure out why programs I compile with it don't seem to work even though they ressble tasm compiled programs I have gottent to work. out of couriosisty, why inst there a straight build option where the headers and all are just the same way that tasm does it?
I would like to suggest heading over to revsoft and trying out SPASM.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

necro wrote:sure...can I get an email adress?
Try the (email) button under the post. ;)
I can't figure out why programs I compile with it don't seem to work even though they ressble tasm compiled programs I have gottent to work.
Neither can I. I'm puzzled!
out of couriosisty, why inst there a straight build option where the headers and all are just the same way that tasm does it?
If you look at the size of the header file's code, you'd notice that there's a lot of it (declaring character mapping, adding in icons/descriptions, even putting on a footer for 83 programs). At least this way breaks the code away from the headers.

There's nothing stopping you from doing it the TASM way, though. Create a new project, open the main source file, nuke all the template code from it (the "Main" bit), then go File->Project Properties and select it as the file to build instead of Headers.asm.
necro
Calc King
Posts: 1619
Joined: Sat 26 Mar, 2005 2:45 am
Location: your shadow

Post by necro »

So, um, did you recieve them?
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

necro wrote:So, um, did you recieve them?
I'm afraid not. :\ If you didn't put in a subject line (or a non-descriptive one) chances are it was removed as spam. (I have to sort through ~200 emails every morning, so be kind). Unless you're sending from a linuxmail.org or .jp domain, that is, where it'll be deleted before it even gets to my inbox...
User avatar
Halifax
Sir Posts-A-Lot
Posts: 225
Joined: Mon 01 Jan, 2007 10:39 am
Location: Pennsylvania, US

Post by Halifax »

One recommendation. DO NOT use TASM compiled source with SPASM. It will create a world beyond frustration for you. Or the other way around DO NOT use SPASM compiled source with TASM. So if working with someone on a project make sure you both have a copy of the same compiler. I was devasted when this happened to me and I tried to compile my source that compiled fine with TASM on SPASM and got 311 errors. I was like O.o
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Brass 2 will probably head this way too, though I might write a TASM compatibility plugin.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Halifax wrote:One recommendation. DO NOT use TASM compiled source with SPASM. It will create a world beyond frustration for you. Or the other way around DO NOT use SPASM compiled source with TASM. So if working with someone on a project make sure you both have a copy of the same compiler. I was devasted when this happened to me and I tried to compile my source that compiled fine with TASM on SPASM and got 311 errors. I was like O.o
Thats REALLY odd. Theres only 2 or 3 things different from my understanding, the most damaging being .org.
Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I've never had anything assemble differently between any of the 3 assemblers until I made some Brass specific code and some Spasm specific code.
Image
Post Reply