Recent Forum Posts
From categories:
page »

Axe Parser is a great alternative that compiles on-calc. If you don't have assembly experience, it will be a bit of a learning curve, but it's powerful and fast.

Z80 Assembly>English>TI-BASIC>Python>French>C>0

Re: Compile to Assembly by Xeda ElnaraXeda Elnara, 28 Jul 2018 18:18
Compile to Assembly
Benjamin Brownlee (guest) 18 Jul 2018 01:06
in discussion Coding Forums / z80 programming » Compile to Assembly

I was curious if anyone is a aware of another language that can be compiled to z80 assembly and uploaded to a calculator. I know Ti-Basic exists, but (Ti-Basic is slow and limited and) I was looking for something that would be compiled once and then run on the calculator as assembly.

Compile to Assembly by Benjamin Brownlee (guest), 18 Jul 2018 01:06
Witerat (guest) 27 Jun 2018 05:23
in discussion Hidden / Per page discussions » LD

I'm pretty sure the table on this page is missing these operations
36 n LD (HL),n ;10 T-states
DD 36 d n LD (iX+d),n ;19 T-states
FD 36 d n LD (IY+d),n ;19 T-states

Note that LD (HL),n does appear on opcode reference chart [url]/opcode-reference-chart[/url].
Source: pp211-214 Z80 Reference Guide; ISBN 0-86161-162-4; 1984 Melbourne House Publishers; Alan Tully Author

Real noodles don't try to rule the waves.

by Witerat (guest), 27 Jun 2018 05:23
Derek (guest) 18 May 2018 13:16
in discussion Hidden / Per page discussions » RES

Agreed. It resets a BIT, not a BYTE!

by Derek (guest), 18 May 2018 13:16
Seiign (guest) 10 May 2018 17:28
in discussion Hidden / Per page discussions » RES

It says "Resets the specified byte to zero", It should be "bit" instead of byte.
Also, on another note "Resets to zero" isn't a little redundant? wouldn't be better either just "Resets …" or "Sets … to zero".
Other than that great page for fast info, good job.

by Seiign (guest), 10 May 2018 17:28
#include ""
.org userMem-2
.db $BB,$6D

      ld a,e
      or a
      jr z,Install_Interrupt
      dec a
      ret nz
      im 1

      ld hl,$9900
      ld de,$9901
      ld bc,256
      ld (hl),$9a

      ld    hl,interrupt_start                 
      ld    de,$9a9a                      
      ld    bc,interrupt_end-interrupt_start 
      ld    a,$99
      ld    i,a               
      im    2                 ;switch to mode 2
      ei                      ;enable interrupts

      ex af,af'
      in a,($03)
      and %11111110
      out ($03),a
      call $003A
What programming is this? by GatoradeDCGatoradeDC, 21 Feb 2018 15:26
Aaron (guest) 09 Jan 2018 05:21
in discussion Coding Forums / z80 programming » Weird Z80 behavior

I have this exact same problem, I followed through and instruction by instruction and get the same result. I noticed after the jmp and the weird counting it only takes 2 clock cycles to increase the address where as before the jump it was 4 clock cycles. Did you ever figure this out and get yours working normally?

by Aaron (guest), 09 Jan 2018 05:21

I've begun the process of updating it. It's going to be a total overhaul, so I've been editing a draft of the new page. It is going to be a while :|

Z80 Assembly>English>TI-BASIC>Python>French>C>0

Re: Advanced Math by Xeda ElnaraXeda Elnara, 09 Aug 2017 17:05

I started this, it is not yet complete, but I submitted what I have completed.

Edit: For the most part, complete.

Z80 Assembly>English>TI-BASIC>Python>French>C>0

Re: The Application Header by Xeda ElnaraXeda Elnara, 08 Aug 2017 13:54

I'm sorry, I'm strapped for time so I can't help just yet— maybe in a few weeks.

This page is in need of an overhaul and while I want to keep the cheeky language, it's absolutely incorrect about a few key points. Application headers are restricted to 128 bytes, but only as an upper limit. A minimum header is a few dozen bytes. An example here is 32 bytes and could be less depending on the size of the app name.:

.org $4000
.db $80,$0F, 0,0,0,0
.db $80,$12, $01,$04    ;signing key ID
.db $80,$47, "AppName" ;change the $47 according to name len (last nibble is the length).
.db $80,$81, 1          ;num pages
.db $80,$90             ;no splash
.db $03,$22,$09,$00     ;date stamp
.db $02,$00             ;date stamp signature
.db $80,$70             ;final field

Z80 Assembly>English>TI-BASIC>Python>French>C>0

The Application Header by Xeda ElnaraXeda Elnara, 07 Aug 2017 01:33
Zeda Thomas (guest) 03 Aug 2017 19:23
in discussion Hidden / Per page discussions » Advanced Math

It has been years since I updated this and some of these routines are making me cringe (and some I'm fairly sure are wrong). This page needs a serious update at some point when I get time and I'm not using a phone.

I must have been practically a heathen when I made these routines XD

I have better algorithms and faster codes, comment if you need something or if I forget to edit.

by Zeda Thomas (guest), 03 Aug 2017 19:23

Replying to my own post! :-) Seems I can't edit it.

Anyhow I was in error about the flashing address lines begining at 256… actually 128 . Still stumped. :-)


Hi All! I just joined the site to hopefully gain some insight into the workings of the Z80. I'm hoping I can build a basic computer around the Z80.
To this point, I've bread-boarded a circuit to verify the CPU iis functioning properly. So far this seems to be the case.
The data lines are all tied low to effect a NOP instruction. All the address lines are driving LEDs through 74LS244 driver ICs.

However, there is something that puzzles me. The address lines count up normally to 65535, but when the count passes 255 any active line from A8 through A15 flashes. The flashing is the same frequency as M1, but opposite… M1 on, A8 - A15 off and vice versa.

I'm stumped. I've downloaded about a ream of documents on the Z80, but I'll be darned if I can see anything to unravel this. I've watched numerous videos about testing the CPU, but no one ever seems to monitor more than 4 or 5 address lines.
I suppose this is normal behavior for some reason given the limited setup I'm using.

Anyone have any thought on this? I'd be grateful!

Amanda - Have a great 4th!
(July 4th - alcohol and explosives. What could wrong?) :-)

Z80 Address Line Functioning by ajwardajward, 01 Jul 2017 18:16

new members!!! Well, that'd be me I guess! I just joined in the hope of learning more about the Z80.
I've started to explore the possibility of building a basic computer using the Z80. So far, I've built a tester to verify the CPU is functioning correctly and I "think" everything is okay. I'll have questions tho', but I'll address those in another area.

Happy to be here.


Re: new members!!! by ajwardajward, 01 Jul 2017 17:34
Zilch (guest) 27 Jun 2017 03:59
in discussion Coding Forums / z80 programming » Read Back program memory

Older processors such as the Z80 did not have any onboard memory, so there is nothing to "read back".

If your system has EPROM (separate non-volatile memory chips, then the contents of these can easily be read out.


by Zilch (guest), 27 Jun 2017 03:59

If you would like, you can add that to the end. It only applies to the eZ80, though (not the Z80).

Z80 Assembly>English>TI-BASIC>Python>French>C>0

This could add a note that the contents of the B register are used as the upper byte of the port number for the (C) version, and the contents of A used as the upper byte for the fixed port version.

Could add the role of B by Piala AlicePiala Alice, 04 Jun 2017 18:38

On the newer models there is:

  • More RAM
  • More Flash
  • A different screen
  • An eZ80 processor

As a result, you'll need to use different graphics routines, and you'll need to use an updated list of addresses for built-in routines (which are now called instead of bcalled).

For the most part, the instruction set is backwards compatible (including an on-chip Z80 mode). However, instruction timings are different and with the introduction of new and more efficient instructions, many of the routines found here can be further optimized.

For the new system calls and addresses, you'll want to check out wikiti.

Z80 Assembly>English>TI-BASIC>Python>French>C>0

Calculator Compatibility
Benjamin (guest) 25 Apr 2017 05:18
in discussion Coding Forums / z80 programming » Calculator Compatibility

I noticed in your basic tutorials on assembly programming that you often reference the TI-83 Plus in set-up downloads and programming but alternate paths for newer calculators are not clear. I was wondering how cross-compatible these tutorials were to newer calculators — especially the TI-84 CE — and what modifications if any were necessary to begin programming in assembly.

Calculator Compatibility by Benjamin (guest), 25 Apr 2017 05:18


Firstly, I haven't looked at Z80 assembly since my childhood back in the late 80's. Whilst I'm quite competent in modern languages, Z80 assembly is something I've never revisited until I recently built a Z80-based single board computer. This runs a version of NASCOM BASIC, which is itself based on Microsoft BASIC from way back in '78.

Now I've got the computer up and running, I'm taking a break from building the next piece of hardware to add to it and instead focusing on the software for the moment. I'd like to make a few (relatively minor) changes to the BASIC interpreter running on the ROM, and in the process learn something about Z80 assembly etc.

What I'm currently trying to do is make the error messages a little more verbose. My first computer was an Amstrad CPC464, so naturally I'm trying to make the BASIC a little more like what I'm used to (already changed the OK prompt to READY.)

I'm hitting a problem with the error messages though. In its untouched form, the error messages are two-character bytes, like so:

ERRORS:     .BYTE   "NF"            ; NEXT without FOR
            .BYTE   "SN"            ; Syntax error
            .BYTE   "RG"            ; RETURN without GOSUB

Now the following lines of code handles printing a message:

ERROR:      CALL        CLREG           ; Clear registers and stack
            LD          (CTLOFG),A      ; Enable output (A is 0)
            CALL        STTLIN          ; Start new line
            LD          HL,ERRORS       ; Point to error codes
            LD          D,A             ; D = 0 (A is 0)
            LD          A,'?'
            CALL        OUTC            ; Output '?'
            ADD         HL,DE           ; Offset to correct error code
            LD          A,(HL)          ; First character
            CALL        OUTC            ; Output it
            CALL        GETCHR          ; Get next character
            CALL        OUTC            ; Output it
            LD          HL,ERRMSG       ; "Error" message
ERRIN:      CALL        PRS             ; Output message

Now initially (and somewhat naively) I thought I could just change the 2-character bytes in ERRORS: from, e.g. "SN" to "Syntax" - the word " Error" is added after each error message. I soon realised that this wasn't working, as there's a lookup table listing the location of each error message. Once I found that, all seemed to be roses for a while. I changed the code above so that instead of printing 2 characters and then moving on, it would loop through printing characters until it hit a 0.


NF          .EQU    00H             ; NEXT without FOR
SN          .EQU    02H             ; Syntax error
RG          .EQU    04H             ; RETURN without GOSUB
OD          .EQU    06H             ; Out of DATA
FC          .EQU    08H             ; Function call error
OV          .EQU    0AH             ; Overflow
OM          .EQU    0CH             ; Out of memory

I added a zero to the end of each message in ERRORS: and changed the 2-char message to a more verbose one (so .BYTE "NF" became .BYTE "NEXT without FOR",0). I then amended the BASIC ERROR CODE VALUES lookup table (above) to take the length of the verbose error messages into account.

Everything was fine for the first few error messages. I'd tested the system and it worked. So I changed the rest of the error messages and updated the lookup table. Some of the values went as high as 124H etc, and I found I had to add a 0 to the lower offsets to avoid errors in TASM. However, I then started getting other errors - unused MS data errors in lines like LD E,(OS). I suspected this was because the offset was too large for a single 8-bit register like E, so where the errors came up I changed the code to LD DE,(<error msg offset label>) to make use of the full 16-bit DE register.

Obviously that didn't work - it stopped my ROM completely and locked the computer up. So, my long-winded question is winding to its conclusion - I don't currently know enough about assembly or the Z80 registers or the BASIC code I'm editing to know what I did wrong and why it was locking up the computer. I suspect this next bit of code is the culprit - taken from the message printing code further up:

LD          D,A             ; D = 0 (A is 0)
LD          A,'?'
CALL        OUTC            ; Output '?'
ADD         HL,DE           ; Offset to correct error code

If the error offset is loaded into E, then the first line above doesn't mess with it. But if, after I changed it to load into DE, D is then changed by the above code snippet, then the offset is going to be corrupted. Should I just remove the LD D,A line and the two after it as I'm not bothered about having the ? mark at the start of the error message either…

page »
Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.