oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Feb 26, 2008 23:11:22 GMT -5
The long subject name says it all! ASMX is able to assemble both for 68k and z80 (sega coprocessor)
a working example:
' Z80 fun with bex using the new ASMX compiler
' Load the z80 code and start the CPU z80gogo z80_start ' Wait for z80 to execute sleep 1 ' Halt the Z80 and retrieve data z80_stop z80_addr& = &hA01000 for a=1 to 8 print right$(hex$(peek(z80_addr&)),2); z80_addr&++ next
' Start the Z80 again (does nothing!) z80_stop end
declare asm sub z80gogo() ; Stop the Z80 CPU, wait for Z80 BUSACK, write the z80 driver to 8k ram, and reset the Z80 jsr __FUNC_z80_stop jsr __FUNC_z80_wait lea @z80_driver(PC),a0 lea $A00000,a1 move.w #@z80_driver_end-@z80_driver,d0 @loop: move.b (a0)+,(a1)+ dbra d0,@loop bsr __FUNC_z80_reset rts @z80_driver: CPU Z80 RORG $0000 ; Z80 Code starts here ; Do something simple, like store $123456789ABCDEF0 in address $1000 of z80 memory ld hl,$1000 ld a,$12 ld (hl),a inc hl ld a,$34 ld (hl),a inc hl ld a,$56 ld (hl),a inc hl ld a,$78 ld (hl),a inc hl ld a,$9A ld (hl),a inc hl ld a,$BC ld (hl),a inc hl ld a,$DE ld (hl),a inc hl ld a,$F0 ld (hl),a inc hl jp $ REND CPU 68000 EVEN @z80_driver_end: end sub
declare asm sub z80_wait() @loop: btst #8,($A11100) bne @loop end sub
declare asm sub z80_stop() move.w #$100,($A11200) move.w #$100,($A11100) end sub
declare asm sub z80_reset() move.w #$000,($A11200) ; on real hardware, this delay is suppose to be much longer nop nop nop nop move.w #$100,($A11200) end sub
declare asm sub z80_start() move.w #$000,($A11100) end sub
|
|
oompa loompa
I AM THE GOVERNATOR
"Git 'Er Dun!"
Posts: 1,301
|
Post by oompa loompa on Feb 27, 2008 1:37:54 GMT -5
Also, I have kaneda's MVSTracker driver playing with basiegaxorz. The basiegaxorz version is extremely buggy! I think it's with the byte/word aligns or whatever. Everything is not 100% there, only loading FM music is implemented. If there is a good use for using mvstracker with bex, i'll work on it more later BEX "Package" -> devster.monkeeh.com/sega/mvstracker_bextest.zipWhen compiling the bex source, make sure to turn on the option "copy output file to project's directory and rename" in options, so that bex will find the other binaries Kaneda's MVSTracker suite page -> www.spritesmind.net/_GenDev/index.php?page=mvst
|
|
|
Post by jlf65 on Mar 1, 2008 18:46:18 GMT -5
Being able to add Z80 assembly to your proggy is pretty cool. Maybe folks will make more use of it now.
|
|