diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-02-18 07:35:54 -0500 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-02-18 07:35:54 -0500 |
commit | e8b1808eaf87a49e4c34ebbfb66854baa627418c (patch) | |
tree | 8a4bb15321992702b6b26e34bd2ed3a55bb7b0d9 /alarm | |
parent | 6cc5652a8af3361288393718ec2adb2889c9af1e (diff) |
Moves assignments to given course folder.
Diffstat (limited to 'alarm')
-rw-r--r-- | alarm/alarm.asm | 65 | ||||
-rw-r--r-- | alarm/assign.rst | 25 |
2 files changed, 0 insertions, 90 deletions
diff --git a/alarm/alarm.asm b/alarm/alarm.asm deleted file mode 100644 index dd094ed..0000000 --- a/alarm/alarm.asm +++ /dev/null @@ -1,65 +0,0 @@ -; -;30h-39h hold the 7seg bit patterns - mov 30h, #11000000B - mov 31h, #11111001B - mov 32h, #10100100B - mov 33h, #10110000B - mov 34h, #10011001B - mov 35h, #10010010B - mov 36h, #10000010B - mov 37h, #10000111B - mov 38h, #10000000B - mov 39h, #10011000B - - mov -start: - - - -jmp start -;40h-42h hold the 3 digits to display - -display: - mov acc, 50h - mov b, #1000 - div ab - mov 40h, acc - mov acc, b - mov b, #100 - div ab - mov 41h, acc; save 100's digit - mov acc, b ;put remainder in a - mov b, #10 ;find 10's & 1's digit - div ab - mov 42h, acc ;save 10's digit - mov 43h, b ;save 1's digit - - - -;display: - mov r1, #40h ;digits[0] - -loop: ;for each digit - mov acc, #30h - mov r3, acc ;save acc;next blob: - -;safe if you don't care about the -;bits of P3 other than p3.3 & p3.4 - mov a, r1 ;picks which - cpl a ;7seg to use p3.3 & - anl a, #03h ;p3.4 are a func - rl a ;of the low2 bits of - rl a ;the addr where the - rl a ;digits live - mov p1, #0ffh;undraw previous - mov p3, a ;set new 7seg - mov a, r3 ;restore acc - -; p1 = pattern[digit[i]] - add a, @r1 - mov r0, acc - mov p1, @r0 - inc r1 -; mov p1, #0ffh - cjne r1, #44h, loop - ret diff --git a/alarm/assign.rst b/alarm/assign.rst deleted file mode 100644 index f9c802a..0000000 --- a/alarm/assign.rst +++ /dev/null @@ -1,25 +0,0 @@ -=========== -Alarm clock -=========== - -Write an 8051 program which implements an alarm clock. This project will -have two phases, the first of which is described here. The alarm clock -runs all the time, with the current time displayed on the four 7-segment -displays. In this first phase your clock needs to: - 1. use timers to keep time updated to the second - 2. switch between 12 hour and 24 hour modes based switch bank.0 (0==12 - hr, 1==24hr) - 3. if you are in 12 hour mode, use the decimal point on the last - 7-segment display to indicate AM or PM (off = AM, on == PM) - 4. switch between display of hours:minutes and minutes:seconds based on - switch bank.1 (0==hours:minutes, 1==minutes:seconds) - 5. keep the decimal point of the second 7-segment display lit as a - visual separator - -AM/PM should remain indicated regardless of which display mode you are -using. - -You do not (yet) need to be able to: - - set the time (pick a starting value) - - set an alarm time - - perform an alarm |