Author Topic: Prizm Assembler  (Read 4760 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Prizm Assembler
« on: April 22, 2011, 03:19:58 am »
It's taken awhile, but we finally have a working assembler.  ;D

The Gnu Assembler, which has supported SuperH processors for some years has finally been compiled by Jonimus for Prizm use and was announced at the last HWCP. However, the syntax is a bit odd. After spending multiple hours playing around (read: me kicking my computer until it assembled correctly) with the assembler, we've finally managed to get it to properly assemble the binaries. Here are some examples of the syntax:

Code: [Select]
stc vbr,R1
mov.l bar,R2
mov.l bur,R3
bsr next
next: add R1,R2
mov.l R3,@-R2
sts pr,R4
.word 0x7408
.word 0xC301
nop
nop
nop
bar: .long 0x00000100
bur: .long 0x0000000B
nop
nop
nop
nop
/* comments*/

-----------------------
Assembled code:

0122
D205
D305
BFFF
321C
2236
042A
7408
C301
0009
0009
0009

0000 0100

0000 000B
0009
0009
0009
0009

Code: [Select]
stc.l sr,@-R15
mov #0x01,R9
mov #0x01,R10
add R8,R9
add R8,R10
mov #0x01,R13
Loop:
mov.l @R9+,R11
mov.l @R10+,R12
cmp/eq R11,R1
bt/s jump
add #0x29,r13
tst R13,R13
bt/s return
nop
bra jump
nop
jump:
nop
return:
nop
nop
/* Comment */

-------------
Assembled code:
4F03
E901
EA01
398C
3A8C
ED01
Loop:
6B96
6CA6
31B0
8D05
7D29
2DD8
8D03
0009
A000
0009
jump:
0009
return:
0009
0009


However, while it will assemble correctly under certain circumstances, it is extremely fussy about the quality of the code. As a general rule, if it throws a single error, no other portion of code will have assembled correctly. It's pretty much all or nothing. Also, the comments at the end are there because the assembler complains if they're not.

Happy hacking :)

sh3eb-elf-as.exe Assembler
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline JonimusPrime

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 389
  • Rating: +25/-5
    • View Profile
    • Jonimoose.net
Re: Prizm Assembler
« Reply #1 on: April 22, 2011, 04:16:46 am »
You're welcome for that by the way. http://jonimoose.net/calcstuff/prizm/ has all the complete toolchain as well, along with some of my other prizm stuffs. Hopefully soon you won't need to manually edit g3a files and the toolchain will have everything to just spit one out for you.

"Always code as if the person who will maintain your code is a maniac serial killer that knows where you live" -Unknown

"If you've done something right no one will know that you've done anything at all" -Futurama

"Have a nice day, or not, the choice is yours." Tom Steiner

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Prizm Assembler
« Reply #2 on: April 23, 2011, 02:14:52 am »
Well it looks like my Super H assembler project isn't unneeded yet because the GNU version has a difficult syntax. I'm still trying to implement a very loose syntax with high level additions and such. But for the time this will work perfectly.
* z80man goes off to assemble his secret game


List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Prizm Assembler
« Reply #3 on: April 23, 2011, 08:08:39 am »
Great work Jonimus! I'm very happy to hear that there is a working assembler for the Prizm available now. :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Prizm Assembler
« Reply #4 on: May 12, 2011, 05:42:40 pm »
Great job!