Hello since the previous problem I have thouhgt of a new suggestion and wandering if it will work so here it is.THANKS if u can help.I want to enter a three digit value from a keypad to the z180 board via assembly language.So if I make the keypad enter three digits on the keypad screen and store this value in a register in assembly:

in0 a,(Kpadvalue);
add af,hl
push af

will it store the three digit number from the keypad in a three digit value in the accumulator as it should convert it to binary rite?eg
360 entered on keypad
then 360 will be converted into binary and stored in the accumulator?is this correct?? :confused:
Posted on 2001-11-26 11:19:58 by thepineapple1
Hi again,

About your previous question concerning registers, my answer is: probably. But it's a very small code, so perhaps you can optimize it to save one or even two registers, but I don't think so. Well, if you don't mind pushing and popping all around the code, you may just use four of them, but it would be better to push previously the registers you want to save, and pop them after.

About your last question: no, you can't do it that way. The IN operand only retrieves an 8 bit value each time. But it depends on the characteristics of the Keypad you are using; maybe you can retrieve a bigger value using two consecutive IN, I have no way to know it. But, of course, you can retrieve values below 256.

In the Z80 architecture (which the Z180 belongs to), the accumulator is the A register, and it's only 8 bits. So managing 16 bit values is a bit tricky. AF joins the A and F register for some 16 bits operations, like BC, HL, and DE.

Sorry if it doesn't help, feel free to ask for further information.


Posted on 2001-11-26 16:39:58 by Wavemaker
Is thecode use in Z80 the same as Z180 ?Also iwant to ask is after I use a particular register initially can i then store the value in memory so I can reuse the register??if so how?THANKS u have been very helpfull ....
Posted on 2001-11-27 05:38:02 by thepineapple1
The only difference between the two instruction set operands is the behavior of the carry flag after RLD/RRD instructions and the result of DAA after a DEC instruction. There are other differences, mainly:


2.5 MHz
64 K addressable
256 bytes I/O address


11 Mhz
1 MB addressable
64 K I/O address

The refresh cycle is also different. As you see, almost everything important remains the same.

Of course, you can store the value of any register:

PUSH (8bit register or 16bit register pair)

POP (8bit register or 16bit register pair)

Or you can store it in a memory address (works with 16 and 8 bits registers):

ld (nnnn),a ; save content of a register in nnnn (16 bit memory address

And retrieve it later:

ld a,(nnnn)

If you want an opcode list I'll send it to you.


Posted on 2001-11-27 07:19:21 by Wavemaker
Yes a opcode list would be very handy thanks
Posted on 2001-11-28 10:10:04 by thepineapple1
I'd like an Z80 opcode list too please :)

I've got a TI83 calculator and plan on trying some assembly on it some time (meanwhile I'll just download my programs from calc.org :tongue: )
Posted on 2001-11-28 13:01:43 by Qweerdy
Well, I can't do it since your profile specifies that you don't want to receive messages thru the board, so... Anyway, try a search in google (z80.txt) and, of course, in www.zilog.com


Posted on 2001-11-28 15:00:31 by Wavemaker