juice2839 Posted November 26, 2015 Share Posted November 26, 2015 (edited) Is Tiniasm the assembler of choice? Is there not anything with an IDE. I did find this http://www.z80.info/zip/as8080.zip It looks pretty nice, but it seems to error out on Mnemonics that seem right. Like LD A,00 gives an error. If it had some documentation I think it could be a good tool. At any rate what do you guys use for your assemble and IDE for z-80 if any? Oh let me add I use windows 7. Edited November 26, 2015 by juice2839 Quote Link to comment Share on other sites More sharing options...
Kiwi Posted November 26, 2015 Share Posted November 26, 2015 I just use tniasm with the window's Run command if I want to compile something that is asm. It comes with directive information. I use Notepad++ for programming. it ability to clone to another view box helps me since I have problem with remembering variable and function names. Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 I just use tniasm with the window's Run command if I want to compile something that is asm. It comes with directive information. I use Notepad++ for programming. it ability to clone to another view box helps me since I have problem with remembering variable and function names. That just seems like such a difficult way to do it. Then you have to open a txt file to see if you have errors? Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 Any idea in the world why this assembler is giving these errors ? This is what that IDE with assembler I set a link to in the first post outputs when I tried to assemble some simple code. ~Invalid Directive, Operation or Macro ~ ld ld a,0 ; Initialising the partial sum ~Invalid Directive, Operation or Macro ~ ld ld hl,$1000 ; Initialising the pointer to the first byte of the data ~Too many operands ~ a,(hl) 8000 87 add a,(hl) ; Adding the current data to the sum ~Invalid Directive, Operation or Macro ~ inc inc hl ; Proceeding to the next byte of the data ~Too many operands ~ a,(hl) 8001 87 add a,(hl) ~Invalid Directive, Operation or Macro ~ inc inc hl ~Too many operands ~ a,(hl) 8002 87 add a,(hl) ~Invalid Directive, Operation or Macro ~ inc inc hl Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted November 27, 2015 Share Posted November 27, 2015 What's "800x 87"? Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted November 27, 2015 Share Posted November 27, 2015 Also, my assembly is severely lacking (I'm looking at a book in Z80 programming right now which I haven't actually started reading yet) but shouldn't it be "INC (HL)" instead of "INC HL"? Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 (edited) What's "800x 87"? I think it was giving the offset from my start address in the error listing. I started with org 8000. This program has a nice IDE and seems simple to use. I can't figure out the assembler though LOL Edited November 27, 2015 by juice2839 Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 Also, my assembly is severely lacking (I'm looking at a book in Z80 programming right now which I haven't actually started reading yet) but shouldn't it be "INC (HL)" instead of "INC HL"? It depends on if you want to inc what at location hl or what in hl. Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted November 27, 2015 Share Posted November 27, 2015 It depends on if you want to inc what at location hl or what in hl. According to my Z80 book, "inc hl" is not legal. Only "inc (hl)" is legal. Also, what are you trying to do with "ld hl,$1000"? Is "$1000" an hexadecimal number? Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 According to my Z80 book, "inc hl" is not legal. Only "inc (hl)" is legal. Also, what are you trying to do with "ld hl,$1000"? Is "$1000" an hexadecimal number? I may be wrong on the mnemonic I am using, but I think you should be able to inc hl the absolute value and inc the data at location hl. $1000 is hex. Some assemblers like the format 0x1000 some like &H1000 and so on. This one says that it uses the Intel structure.... I tried a few different ways like ld hl,0x9999 or ld hl,$9999 but it does not seem to matter. Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 I tried it with inc (hl) still errors out.. Invalid Directive, Operation or Macro ~ ld ld a,0 ; Initialising the partial sum ~Invalid Directive, Operation or Macro ~ ld ld hl,$1000 ; Initialising the pointer to the first byte of the data ~Invalid Directive, Operation or Macro ~ inc inc (hl) ~Invalid Directive, Operation or Macro ~ a,(hl) add a,(hl) Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted November 27, 2015 Share Posted November 27, 2015 I may be wrong on the mnemonic I am using, but I think you should be able to inc hl the absolute value and inc the data at location hl. I understand what you're saying, but it seems you have to increment HL indirectly somehow. It may even be incremented automatically if you do it right, but anyone else with some Z80 assembly experience should be able to help you far better than I can. $1000 is hex. Some assemblers like the format 0x1000 some like &H1000 and so on. This one says that it uses the Intel structure.... I tried a few different ways like ld hl,0x9999 or ld hl,$9999 but it does not seem to matter. My Z80 book gives this example for loading a value into HL: LD (HL), 5A I'm just doing the best I can here. I'm like a guy who tries to translate Spanish without actually knowing the language. Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 (edited) I understand what you're saying, but it seems you have to increment HL indirectly somehow. It may even be incremented automatically if you do it right, but anyone else with some Z80 assembly experience should be able to help you far better than I can. My Z80 book gives this example for loading a value into HL: LD (HL), 5A I'm just doing the best I can here. I'm like a guy who tries to translate Spanish without actually knowing the language. LOL right.. You should download that IDE and assembler. It's dead simple and if someone can figure out what the deal is with the assembler I think it would be a great tool. Edited November 27, 2015 by juice2839 Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted November 27, 2015 Share Posted November 27, 2015 I tried it with inc (hl) still errors out.. That's weird. My Z80 book has an entire reference page devoted to "INC (HL)"... Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 That's weird. My Z80 book has an entire reference page devoted to "INC (HL)"... Its the assembler not working right or some little nuance I am missing with it. Or maybe it's just not windows 7 compatible. It would be cool if someone else took a look at it. I guess I could use that tiasm, but not having an IDE sucks.... It must be everyone has moved over to programming in C++ or something. It's been 15+ years since I have programmed in assembly. I used Tasm and DOS last time, but I really really don't want to go back to that.. LOL Quote Link to comment Share on other sites More sharing options...
Kiwi Posted November 27, 2015 Share Posted November 27, 2015 (edited) Does your code have "cpu z80" in it?Here is a pre-setup asm with bios call alias and the header information that the Colecovision need for it to boot up the cartridge. for_tniasm.asm Edited November 27, 2015 by Kiwi Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 This is a pretty good listing of the z80 instruction set too. I guess I could get really crazy and do it like we did it in the 80's and just use machine language.. Ouch.. http://nemesis.lonestar.org/computers/tandy/software/apps/m4/qd/opcodes.html Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 Does your code have "cpu z80" in it? Here is a pre-setup asm with bios call alias and the header information that the Colecovision need for it to boot up the cartridge. for_tniasm.asm I'm using that IDE / Assembler I set a link to in the first post not Tiasm. Not sure if you caught that. I did try it with the z80 cpu just for kicks but it gave an error on that too. Invalid Directive, Operation or Macro ~ cpu cpu z80 8000 org 0x8000 ~Invalid Directive, Operation or Macro ~ ld ld a,0 ; Initialising the partial sum ~Invalid Directive, Operation or Macro ~ ld ld hl,$1000 ; Initialising the pointer to the first byte of the data ~Invalid Directive, Operation or Macro ~ inc inc (hl) Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 I think I figured it out..... It wants the Intel 8080 style of Mnemonic which sucks, but at least it has an IDE. 8000 org 0x8000 8000 78 START MOV A,B 8001 79 MOV A,C 8002 7A MOV A,D ~Invalid Directive, Operation or Macro ~ LD LD A,D 8003 7B MOV A,E ~Invalid Directive, Operation or Macro ~ LD LD A,E ~Too many operands ~ A,H LD A,H ~Bad register ~ H LD A 8004 78 MOV A,H LD A,H 8005 7D MOV A,L Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 I just use tniasm with the window's Run command if I want to compile something that is asm. It comes with directive information. I use Notepad++ for programming. it ability to clone to another view box helps me since I have problem with remembering variable and function names. You have to check this one out. http://retrospec.sgn.net/game-links.php?link=z80asmThis one looks really good. I just found it so I have not fully tested it but I like it already. It has a nice simple IDE. Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted November 27, 2015 Share Posted November 27, 2015 both inc (hl) and inc hl, is valid Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 (edited) both inc (hl) and inc hl, is valid YEAH I got it to assemble with no errors........... org #8000 vdp1: equ #be ;mtx #1 - cv=$be - msx=$98 vdp2: equ #bf ;mtx #2 - cv=$bf - msx=$99 sound: equ #f0 ;mtx #6 - cv=#f0 - msx=n/a psglatch: equ #50 psgrd_wr: equ #51 org #8000 db #55,#aa ;55aa show title aa55 jmp to START db #00,#00 ;vector 1 (always 0000 or ram 7xxx) db #00,#00 ;vector 2 (always 0000 or ram 7xxx) db #00,#00 ;vector 3 (always 0000 or ram 7xxx) db #00,#00 ;vector 4 (always 0000 or ram 7xxx) dw START ;vectorcode db #C9,#00,#00 ;jmp rst $08 db #C9,#00,#00 ;jmp rst $10 db #C9,#00,#00 ;jmp rst $18 db #c9,#00,#00 ;jmp rst $20 db #c9,#00,#00 ;jmp rst $28 db #c9,#00,#00 ;jmp rst $30 db #c9,#00,#00 ;jmp rst $38 db #c9,000,000 ;jmp nmi (vert.blank int vdp) db "TEST CV",#2F ;titlescreen (if aa55) db "LINE 2",#2F ;Line 2 db "2013",#2F ;display year ;************************************************************** START: di ld sp,#73b9 ;SET STACK POINTER call #1FD6 ;TURN OFF SOUND call PSG_OUT ;MAKE PSG OUTPUT BEGIN: ld b,#33 ;START OF ALLOPHONES LOOP: ld a,b ;LOAD A WITH ALLOPHONE add a,#c0 ;BIT 7&8 HIGH call PSG_DAT ; sub #c0 ;SETUP BIT 7&8 LOW call PSG_DAT ;SAY ALLOPHONE call DELAY_1 ;DELAY dec b ;SUBTRACT 1 NEXT ALLOPHONE jp nz, LOOP ;ZERO? NO - LOOP jp BEGIN ;ZERO? YES - SAY THEM AGAIN call PSG_IN ;NOT USED YET DELAY_1: push bc ld b,#FF J61: ld d,#FF J62: dec d jp nz,J62 dec b jp nc,J61 pop bc ret PSG_OUT: ld a,#7 ;SELECT ENABLE REGISTER out (psglatch),a ; ld a,%11000000 ;MAKE I/O PORT OUTPUT out (psgrd_wr),a ld a,#16 ;SELECT IOA REGISTER out (psglatch),a ld a,#0 PSG_DAT: out (psgrd_wr),a ;SET OUPUTS LOW ret PSG_IN: ld a,#7 ;SELECT ENABLE REGISTER out (psglatch),a ; ld a,0 ;MAKE I/O PORT INPUT out (psgrd_wr),a ld a,#16 ;SELECT IOA REGISTER out (psglatch),a ld a,(psgrd_wr) ;GET IOA INPUT IN A ret STOP: jp STOP Edited November 27, 2015 by juice2839 Quote Link to comment Share on other sites More sharing options...
CrazyBoss Posted November 27, 2015 Share Posted November 27, 2015 you have a bug : ld a,(psgrd_wr) sould be in a,(psgrd_wr) I made that mistake too Quote Link to comment Share on other sites More sharing options...
juice2839 Posted November 27, 2015 Author Share Posted November 27, 2015 you have a bug : ld a,(psgrd_wr) sould be in a,(psgrd_wr) I made that mistake too Thanks Quote Link to comment Share on other sites More sharing options...
NIAD Posted November 27, 2015 Share Posted November 27, 2015 Hmmm... from that program listing, it looks like you are working on a Voice Synthesizer on the CV? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.