Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
BASM-3 is an on-calc assembler for the TI-84+CE line of graphing calculators, written in C.
This project is going smoothly so far now that I've decided to hardcode the opcodes rather than using some weird table of values.
Includes will be implemented, of course.

The style of BASM is similar to fasmg, but uses a lot of implied first arguments, such as "xor" and "or".

Code:

format asm "OUTBIN"
xor a,a
sbc hl,hl
ld (labelIdk),hl
ret
labelIdk:
DL 0
DW 0
DB 0

All of the opcodes and defines are and will be case-insensitive.

"DL" emits a "Long" 3 byte number,
"DW" emits a "Word" 2 byte number.
"DB" emits a byte.
labels are marked with a trailing colon. ":"
Number bases are marked by a "." followed by a "B" for binary, an "X" for hex, a "D" for decimal, or an "O" for octal.

In BASM, labels and undefined words are calculated and written after the file has been assembled.

Once this is done, I will be uploading it to the archives, and the source is on GitHub.
I've decided that labels are probably gonna be easier to implement if they are found during a prescan, so I'm gonna do that instead of a postscan for the time being.

Exclamation BASM-3 Github Exclamation
Finally got labels to work, but half the opcodes are still not yet working.

Syntax update:
Number base identifiers now use a "." instead of a "?".
Valid bases:

Code:

.XFF
.O377
.B011111111
.D255

".D" is the default number base 10. Only really useful for switching number bases within the number.

Example BASM program:

Code:

format asm "OUTBIN"
Main:
xor a
jp nz,Main
ret


Additionally, I have decided to completely redo the opcode matching and argument parsing system.
The opcodes and built-ins will now be stored in an external appvar, and will be indexed using a binary search tree.
So far this Project sound amazing but I want to see it in action how does it look on the calc. anyway Good Job so far Smile
BASM-3 is nearing completion! Here's some eye candy:


It's fast too! Very Happy Very Happy Very Happy
Very cool! I agree that it's fast at this stage.

Is there a way to 'include' an appvar or something with CE definitions to save having to declare at the start of a program?
tr1p1ea wrote:
Very cool! I agree that it's fast at this stage.

Is there a way to 'include' an appvar or something with CE definitions to save having to declare at the start of a program?


Actually yes! Just there aren't any provided with the program just yet.
EDIT: BASM include files are not the same as BASM source files.


Code:

include "AVNAME"


I am close to an alpha release, there's just some recursion bugs I need to work out. Such as labels that use other labels which are defined after the current label definition. lol

Also: I'm surprised that it runs so fast at this stage considering the algorithm I use to select opcodes.
I basically had to write a lexer to extract the opcode from the program line. Also I did the same thing with values, just extracting the opposite.
After that, the opcode data appvar is indexed with the first letter, and the rest is strncmp Laughing
BASM Is now pre-released on Github!!!
Be sure to report bugs and provide feature suggestions here!
BASM 3.1 has now been released on GitHub!
With this pre-release comes many bugfixes, and a few new features:
"JP (IX)" now works correctly.
Extra spaces in the opcode now work correctly.
Leading spaces are also (finally) implemented!
BASM 3.2 has now been released on GitHub!
In this update, even moar bugfixes!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement