I wrote these programs primarily so I could have a z80 assembler that ran in windows, but was simple and lite on overhead.
The Assembler and Dis-assembler will handle all standard opcodes in Zilog Format. Non of the extended opcodes are supported.
The emulator needs some more testing, the known issues are with the DAA (Decimal Adjust Accumulator) and the IN and OUT and related instructions. Don't yet have a plan on how to handle In and Out, maybe with an extra window where the valuse can be manipulated.
I want to have a window so CPM code can be emulated with output. Need to work on the CPM emulator code inside the Z80 Emulator.
May 15 2013
Last edit: Peter Cook 2013-05-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have finally had some time to beat on these programs a bit more and have been working on improving the handling of immediate mode values.
Relates to things like the DB, DEFB, EQU pseudo ops.
Need to be able to handle things like :
$+offset where the $ means the current PC
$AFE0 , &HAFE0, AFE0H for hexidecimal numbers
01011010B for binary
-2 for a negative literal
"A"+80H and other similar code.
or Lable+offset+offset
As of right now the code I am working on will handle 8 levels of simple math (no parenthesis...)
The straight Z80 stuff works. I recently got interested in a CPM design by Grant Searle - http://searle.hostei.com/grant/ - and wanted to test my assembler against his code and I found a number of different pseudo-ops and also much use of expressions that I needed to implement to make this more likely to assemble anything.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Got ASM80.exe working well. Totally rewrote the parsing procedure to make it handle all the possibilities better. Then added 2 functions to handle all the options for byte or word data.
Then to run a test of my file with all instructions - and EX AF,AF' had to be handled special, but all the other instructions worked without a problem. Most of the problems were caused by all the possibilties for immediate literal data.
Word data can use the DW, DEFW or WORD pseudo-ops. Byte data can use the DB, DEFB, BYTE, TEXT of DEFM pseudo-ops. Storage can use the DS or DEFS. A period "." can be placed in front of any of the pseudo-ops without a problem.
the Add'+', subtract'-', multiply'*', or divide'/' can beused with multiple math instructions per line. There is NO OPERATOR PRECEDENCE. Immediate data with math is processed simply from left to right. DON'T USE PARENTHESIS. The possibility of confusing things (or just me is too great...).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just when you think it is working, you need to do one more test...
This version is assembling all the files I throw at it, and with the addition of the '&' operator as a math function I got the latest error.
Had to fix how it handles all the possible DB DEFB BYTE TEXT and DW DEFW WORD options. And corrected the DS DEFS pseudo-op so the just allocate some memory and assign it zeros for now. Intel Hex files don't require that, but CPM files do.
the Add'+', subtract'-', multiply'*', or divide'/' or AND '&' can beused with multiple math instructions per line. There is NO OPERATOR PRECEDENCE. Immediate data with math is processed simply from left to right. DON'T USE PARENTHESIS. the parser and the Immed16 function will be confused by parenthesis in math sequences.
September 2, 2013
Last edit: Peter Cook 2013-09-03
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote these programs primarily so I could have a z80 assembler that ran in windows, but was simple and lite on overhead.
The Assembler and Dis-assembler will handle all standard opcodes in Zilog Format. Non of the extended opcodes are supported.
The emulator needs some more testing, the known issues are with the DAA (Decimal Adjust Accumulator) and the IN and OUT and related instructions. Don't yet have a plan on how to handle In and Out, maybe with an extra window where the valuse can be manipulated.
I want to have a window so CPM code can be emulated with output. Need to work on the CPM emulator code inside the Z80 Emulator.
May 15 2013
Last edit: Peter Cook 2013-05-15
I have finally had some time to beat on these programs a bit more and have been working on improving the handling of immediate mode values.
Relates to things like the DB, DEFB, EQU pseudo ops.
Need to be able to handle things like :
$+offset where the $ means the current PC
$AFE0 , &HAFE0, AFE0H for hexidecimal numbers
01011010B for binary
-2 for a negative literal
"A"+80H and other similar code.
or Lable+offset+offset
As of right now the code I am working on will handle 8 levels of simple math (no parenthesis...)
The straight Z80 stuff works. I recently got interested in a CPM design by Grant Searle - http://searle.hostei.com/grant/ - and wanted to test my assembler against his code and I found a number of different pseudo-ops and also much use of expressions that I needed to implement to make this more likely to assemble anything.
Got ASM80.exe working well. Totally rewrote the parsing procedure to make it handle all the possibilities better. Then added 2 functions to handle all the options for byte or word data.
Then to run a test of my file with all instructions - and EX AF,AF' had to be handled special, but all the other instructions worked without a problem. Most of the problems were caused by all the possibilties for immediate literal data.
Word data can use the DW, DEFW or WORD pseudo-ops. Byte data can use the DB, DEFB, BYTE, TEXT of DEFM pseudo-ops. Storage can use the DS or DEFS. A period "." can be placed in front of any of the pseudo-ops without a problem.
the Add'+', subtract'-', multiply'*', or divide'/' can beused with multiple math instructions per line. There is NO OPERATOR PRECEDENCE. Immediate data with math is processed simply from left to right. DON'T USE PARENTHESIS. The possibility of confusing things (or just me is too great...).
Just when you think it is working, you need to do one more test...
This version is assembling all the files I throw at it, and with the addition of the '&' operator as a math function I got the latest error.
Had to fix how it handles all the possible DB DEFB BYTE TEXT and DW DEFW WORD options. And corrected the DS DEFS pseudo-op so the just allocate some memory and assign it zeros for now. Intel Hex files don't require that, but CPM files do.
the Add'+', subtract'-', multiply'*', or divide'/' or AND '&' can beused with multiple math instructions per line. There is NO OPERATOR PRECEDENCE. Immediate data with math is processed simply from left to right. DON'T USE PARENTHESIS. the parser and the Immed16 function will be confused by parenthesis in math sequences.
September 2, 2013
Last edit: Peter Cook 2013-09-03