You are on page 1of 1

1/1

; Assembler generated listing; Not editable.


; Generated by GNUSim8085: http://www.gnusim8085.org/

;<Program title>

4200 C3 03 042 jmp start

;data

;code
4203 00 start: nop
4204 21 00 01 BEG: LXI H, 0100H ; Load the memory address 0100H into H-L pai…

4207 22 00 00 HR_MIN: SHLD 0000H ; Store the current clock value (HH:…

420A AF N_SEC: XRA A ; Clear accumulator A


420B 32 01 00 STA 0001H ; Store the current seconds value at memory …

420E CD 38 42 CALL DELAY ; Call the DELAY subroutine to introduce a t…

4211 3A 02 00 LDA 0002H ; Load the current seconds value from memory…
4214 C6 01 ADI 01H ; Add 1 to the seconds value
4216 27 DAA ; Decimal adjust the accumulator

4217 FE 60 CPI 60H ; Compare the seconds value with 60H (60 dec…
4219 C2 0A 042 JNZ N_SEC ; Jump to N_SEC if not equal to 60 (not reac…

421C 2A 00 00 LHLD 0000H ; Load the clock value (HH:MM) from memory a…
421F 7D MOV A, L ; Move the contents of L register to accumul…
4220 C6 01 ADI 01H ; Add 1 to the minutes value
4222 27 DAA ; Decimal adjust the accumulator
4223 6F MOV L, A ; Move the modified minutes value back to L …

4224 FE 60 CPI 60H ; Compare the minutes value with 60H (60 dec…
4226 C2 07 042 JNZ HR_MIN ; Jump to HR_MIN if not equal to 60 (not rea…

4229 2E 00 MVI L, 00H ; Reset the minutes value to 00H


422B 7C MOV A, H ; Move the contents of H register to accumul…
422C C6 01 ADI 01H ; Add 1 to the hours value
422E 27 DAA ; Decimal adjust the accumulator
422F 67 MOV H, A ; Move the modified hours value back to H re…

4230 FE 24 CPI 24H ; Compare the hours value with 24H (24 decim…
4232 C2 07 042 JNZ HR_MIN ; Jump to HR_MIN if not equal to 24 (not rea…

4235 C3 04 042 JMP BEG ; Jump back to BEG to continue the clock ope…

4238 0E 02 DELAY: MVI C, 02H ; Initialize C register for delay loop

423A 11 FF 0 L1: LXI D, 00FFH ; Load D register with initial count for tim…

423D 1B L2: DCX D ; Decrement D register


423E 7A MOV A, D ; Move the contents of D register to accumul…
423F B3 ORA E ; Logical OR with E register (E register is …
4240 C2 3D 42 JNZ L2 ; Jump to L2 if accumulator is not zero (del…

4243 0D DCR C ; Decrement C register


4244 C2 3A 42 JNZ L1 ; Jump to L1 if C register is not zero (repe…

4247 C9 RET ; Return from the subroutine DELAY

4248 76 HLT ; Halt the program

http://www.gnusim8085.org/

You might also like