Created
May 25, 2018 19:33
-
-
Save CedricVanhaverbeke/61f9b51fa0650be5f3af242334c38291 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$include (c8051f120.inc) | |
mov cseg at 0000H | |
jmp main | |
mov cseg at 0050H | |
main: | |
clr EA | |
mov WDTCN, #0DEH | |
mov WDTCN, #0ADH | |
setb EA | |
; want output komt terecht in P0.0 | |
mov SFRPAGE, #0FH | |
mov XBR2, #40H | |
mov P0MDOUT, #01H | |
start: | |
; De nand poort, waarde moet naar F1. | |
mov A, 22H | |
rr A | |
rr A | |
rr A | |
rr A | |
anl A, P2 | |
mov 20H, A ; Naar een register laten gaan dat bitadresseerbaar is | |
cpl 20H | |
; de or poort, waarde zit C | |
mov A, P7 | |
mov 21H.1, F0 | |
orl A, 21H | |
; Nu zit in A.1 de waarde van de or poort en in 20H.3 De waarde van de nand poort | |
rr A | |
rr A | |
; Nu zit in A.3 de waarde van de or poort en in 20H.3 de waarde van de nand poort | |
; uiteindelijke and poort, moet terecht komen in P0.0 | |
anl A, 20H | |
mov 20H, A | |
mov P0.0, 20H.3 | |
jmp start | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment