Addition Program for the Z80 Computer

This is a simple addition program that can be entered into RAM using the program loader routine.

Line no.LocationContentsLabelInstructionComment
00010000 ;Z-80 Simple Adding program
00020000 ;2/21/03
00030800 .org 0800h;Start of RAM, program loaded here
00040800 DB 00startin a,(0) ;First number from input port 0
00050802 47 ld b,a ;Put in register b
00060803 DB 01 in a,(1) ;Second number from input port 1
00070805 80 add a,b ;Add to first number
00080806 D3 00 out (0),a ;Output result to output port 0
00090808 18 F6 jr start ;start over.
0010080A .end

Return to main Z-80 computer page.

Donn Stewart 2004