Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I need a Z80 Compiler/assembler

Status
Not open for further replies.

Marks256

New Member
Just like the title says; I need a z80 compiler/assembler. I don't want anything "C" based, just a normal Z80 Assembly compiler. Nothing fancy, just a hardcore assembler for the Z80. I don't want to buy parts, and then not be able to find a compiler...
Also, another question. If i assembled a z80 file, and then wanted to burn the file to a EEPROM, what would it be displayed as on the EEPROM? Does it just copy the ASCII number over the EEPROM, or is it encoded, or something? Like if i sent the word "Hello", would it be stored as; 1001000 1100101 1101100 1101100 1101111 on the EEPROM, or would it be something else?
 
Apparently some of the earlier TI graphing calculators (TI-83) were Z80 based before they switched to the 68000 series, so there seem to be a whole slew of assemblers out there. There's entire *fansites* for the architecture.

http://www.z80.info/

GPL'd assembler/disassembler.
http://wwwhomes.uni-bielefeld.de/achim/z80-asm.html

some nomenclature:
1) An assembler just translates assembly instructions into opcodes, handles relative addressing (i.e. jumps), and usually does macros.
2) An assembler isn't a compiler, compilers tend to do a *lot* more than assemblers.
3) Assemblers typically output binary files, and a secondary output is typically an annoted source file. I usually don't use linkers when dealing with assembly, but that's usually doable too (multiple .asm files -> assembled into multiple object files -> linked into a single binary file)
4) If you tell the assembler to allocate some memory and dump the ascii characters 'H', 'e', 'l', 'l', 'o', it'll happily put the ascii characters into the object file with the other opcodes. (unless you *really* *really* want to do unicode, utf, ebcdic or some other funky encoding...)

James
 
I want to know what the data will show up as in the BootROM. If it is exactally what it shows up as in the file, before being burned, then i would beable to make an EEPROM burner on my BASIC Stamp?
 
The typical "interface" for programming external EPROM/FLASH chips are intel ".hex" files ("intelhex"). These are in ascii and contain all the data in hexidecimal format with some checksum information. These are usually used since most EPROM/FLASH chips are rather sparse with information distributed over the chip at fixed addresses - typically for the processor reset address, interrupt vectors, and then chunks for the actual program code itself.

Some programs might be able to dump out an "image" of the data stored in the PROM, but it isn't that common, and it's easy to write a ".hex" file parser. You'll need to install the assembler and see what the typical output is.
 
So, would i beable to just send the file to my stamp and have it write it to the EEPROM? Or would i need something more?
 
Marks256 said:
So, would i beable to just send the file to my stamp and have it write it to the EEPROM? Or would i need something more?

As long as you write a suitable program on your STAMP, it should be possible - but first you've got to write a programmer on your STAMP?. I'm presuming your reference to 'EEPROM' refers to one of the modern replacements for EPROM's?, and not an I2C EEPROM?. Does the STAMP have enough I/O, or are you going to have to add external latches etc.
 
Well, you'll have to deal with most EEPROM chips having oddball programming sequences - as well as needing 25+ IO lines to connect up all the busses (or adding address latches).

When you say "just send", You'll need to parse the intelhex file, convert the ASCII hex to binary, do the magical EEPROM programming dance, load the required address/data busses, wait for it to finish and then go onto the next data byte.

But yeah, that would work.
 
My stamp has 16 I/Os (BS2). I have two of them, so i have 31 I/O's available(1 pin reserved for serial communication). So, all i have to do is convert the ASCII into Binary, and then send it to my stamp, which will write it to the EEPROM? Doesn't sound too complex. I am already getting ideas... Hopefully i find an EEPROM that has a lot of data available! :) I think i can do this, but could i get a bit more information on what needs to be done? Thanks!
 
Find an EEPROM data sheet and find it's programming section.

Buy some '573 or '574 latches and figure out how to connect them to the stamp. You'll probably need 3 of them to latch the address.

Read the intelhex specification: https://www.electro-tech-online.com/custompdfs/2006/08/intelhex.pdf and figure out how to implement it on the basic stamp, or write some software which "prechews" the format into something simpler for the stamp to process.

I guess that's the important stuff.
 
Well, once i figure out how to read that PDF, then i will make a DOS program to download the program to my Stamp, then to the EEPROM. Thanks!
 
Like hjames pointed out buy some 74HC574's. You could even wire them up to be tri-stated shift registers and connect them in a daisy chain to the parallel port of an older computer. I say old computer because direct IO under XP is a pain in the... Well you know. You could then bypass the STAMP all together, but that is up to you.
Read the description of the circuit below. Substitute the Amtel Micro for a SRAM chip in your mind while reading this: it may give you some more ideas;
**broken link removed**
 
Read the description of the circuit below. Substitute the Amtel Micro for a SRAM chip in your mind while reading this: it may give you some more ideas;

Why would i substitute it for SRAM? Wouldn't i substitute it for my EEPROM? Ahh, i don't like the idea of just having a SRAM chip, i would like BootROM, and some SRAM. Besides, i plan on using this computer as a (graphing)calculator when i get it done. :)

Like hjames pointed out buy some 74HC574's. You could even wire them up to be tri-stated shift registers and connect them in a daisy chain to the parallel port of an older computer. I say old computer because direct IO under XP is a pain in the... Well you know. You could then bypass the STAMP all together, but that is up to you.

What is the Flip/Flop for? I don't understand. Yes, i think i will use the PC based programmer instead. I now about the whole XP emulation stuff. My whole life used to be centered around programming(PC, of course). I have 4 years experience with DOS programming(QBasic, and QB), and about 2 years with Windows programming(VBasic). It should be no problem making the programming software, but i have never made a program that opened a foreign file system. This might be fun! Also, i might need a little help reading the data sheets. Here is the links to the SRAM and EEPROM i am going to get this weekend;

https://www.jameco.com/webapp/wcs/s...01&catalogId=10001&pa=40475CM&productId=40475

https://www.jameco.com/webapp/wcs/s...&catalogId=10001&pa=242341CM&productId=242341


What do you think?
 
Why would i substitute it for SRAM? Wouldn't i substitute it for my EEPROM?
I just thought it might be easier for you to program and would make the Z80 project easier to build. But it looks like the EEPROM you have chosen is pretty easy to program and you also have bigger plans for it in the future.
What is the Flip/Flop for? I don't understand. Yes, i think i will use the PC based programmer instead
The flip-flop, when wired up as in the Amtel programmer example, becomes an 8Bit shift register with tristate outputs. Basically it replaces 2 chips if you used a tristate buffer and shift register. Three of these wired up to the parallel port would allow you to build your own EEPROM programmer.
Here is the links to the SRAM and EEPROM i am going to get this weekend;
Looks good. They should be fast enough for the Z80A running at 4Mhz or so.
 
Yep. Got a Z80A, and i am going to buy one or two more from jameco. I decided to go with 16k models instead. They are pretty much the same as the previous ones though. Thanks! The order should go out this weekend, or on Monday, then i am not sure when it sould come. :) I will post pictures ASAP! :cool:
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top