Jump to content
IGNORED

Are there no good windows IDE's with Assemblers for Z80


juice2839

Recommended Posts

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 by juice2839
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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. :P

 

$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. :P

Link to comment
Share on other sites

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. :P

 

 

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. :P

 

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 by juice2839
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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. attachicon.giffor_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)
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by juice2839
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...