*----------------------------------------------------------- * Title : * Written by : Luigi Coppolino * Date : * Description: Seven segment usage (Address E00000 to the leftmost digit * 2 byte for each digit (the lower one controls the segments * 1 bit per segment *----------------------------------------------------------- ORG $1000 START: ; first instruction of program * Put program code here move.l #irq1,$64 MOVE.B #32,D0 ;task number MOVE.B #1,D1 ;seven digit display TRAP #15 ;load send digit disin D1play address MOVE.L D1,A0 ;clear all MOVE.B #0,(A0) MOVE.B #0,2(A0) MOVE.B #0,4(A0) MOVE.B #0,6(A0) MOVE.B #C,8(A0) MOVE.B #I,10(A0) MOVE.B #A,12(A0) MOVE.B #O,14(A0) MOVE.B #8,D0 MOVE.B #10,D1 MOVE.B #12,D2 MOVE.B #14,D3 LOOP NOP BNE LOOP irq1 MOVE.B D0,-(SP) JSR round MOVE.B (SP)+,D0 MOVE.B D1,-(SP) JSR round MOVE.B (SP)+,D1 MOVE.B D2,-(SP) JSR round MOVE.B (SP)+,D2 MOVE.B D3,-(SP) JSR round MOVE.B (SP)+,D3 ;clear all MOVE.B #0,(A0) MOVE.B #0,2(A0) MOVE.B #0,4(A0) MOVE.B #0,6(A0) MOVE.B #0,8(A0) MOVE.B #0,10(A0) MOVE.B #0,12(A0) MOVE.B #0,14(A0) ;display CIAO MOVE.B #C,(A0,D0) MOVE.B #I,(A0,D1) MOVE.B #A,(A0,D2) MOVE.B #O,(A0,D3) RTE round MOVE.B 4(SP),D4 ;SP + return address (4 bytes) ADDI.B #-2,D4 BLT mod quit MOVE.B D4,4(SP) RTS mod MOVE.B #14,D4 BRA quit SIMHALT ; halt simulator * Put variables and constants here HEX EQU $E00000 C EQU %00111001 I EQU %00000110 A EQU %01110111 O EQU %00111111 END START ; last line of source *~Font name~Courier New~ *~Font size~10~ *~Tab type~1~ *~Tab size~4~