0

I'm trying to write a small z80 program for a ti-84+ and TASM doesn't recognize my arguments for the OUT instruction.

This should be the syntax for the OUT instruction, but TASM doesn't seem to recognize it.

OUT ($10) , $05

Expected Result: no errors, but the actual result is unrecognized argument. (($10),$05)

Nathaniel Smith
  • 106
  • 1
  • 9
  • 5
    Is that TASM, as in the Turbo Assembler, the old x86 assembler? – Thomas Jager Oct 13 '19 at 19:47
  • 4
    `OUT ($10) , $05` <-- Where did you get that example from? There's no `OUT (n), n` on the Z80 that I'm aware of. There's `OUT (n), A` and `OUT (C), R`. – Michael Oct 13 '19 at 20:24
  • 1
    Please provide a link to the TASM you use and its version if appropriate. You see, there is more than one TASM. And then tell us what you like to do. As @Michael said there is no `OUT (n),d` on the Z80. Please [edit] your question, don't hide additional information in a comment. Make sure you took the [tour] and learn [ask]. – the busybee Oct 14 '19 at 06:31
  • 1
    I would also like to throw in that for the Z80, spasm-ng is an excellent, modern assembler, which also has TI-8x specific tools. TASM is ancient at this point. – Zeda Oct 14 '19 at 12:42

1 Answers1

3

I've had this same problem before, the fix is that you cannot give a number to the OUT opcode, you need to use a register. The new code that you would need would be the following

LD A, $05
OUT ($10), A

Another thing about the LCD screen ports is they are slow so i also recommend putting a delay after each use put,

_LCD_BUSY_QUICK    .EQU    $000B

At the beginning of your program because its the easiest delay. so the final code will be,

LD A, $05
OUT ($10), A
call _LCD_BUSY_QUICK

Also tasm is very old and slow so if you get into programming more i recommend spasm as its faster, also if you choose to use spasm, run it through Command Prompt as its much easier then using visual studio and because you use tasm i assume you are already accustomed to using command prompt.

Hope this helps :)

Nathaniel Smith
  • 106
  • 1
  • 9
  • Ah that makes sense. An instruction with 2 immediates would have to be larger, and more complex to decode. Not surprising that Z80 doesn't provide it. – Peter Cordes Oct 14 '19 at 15:07