diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2024-10-15 10:19:30 +0100 |
commit | faef2d81c224b715c5e429d04c59ba50fb772d9e (patch) | |
tree | 2f75197a884ded3486c14e09908cb23bd24b968c /electronics/asm/mem.asm | |
parent | 3564e513623bb3fc4d528d3d29df9aa91dae1396 (diff) |
added a stupid amount of work to zpy, and started the document work in latex
rather than groff
Diffstat (limited to 'electronics/asm/mem.asm')
-rw-r--r-- | electronics/asm/mem.asm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/electronics/asm/mem.asm b/electronics/asm/mem.asm new file mode 100644 index 0000000..0c2d595 --- /dev/null +++ b/electronics/asm/mem.asm @@ -0,0 +1,27 @@ +start: +init: + clrf PORTA ; make sure port A output latches are low + clrf PORTB ; make sure port B output latches are low + bsf STATUS,RP0 ; select memory bank 1 + movlw b'11111111' ; set port A data direction to inputs + movwf TRISA + movlw b'00000000' ; set port B data direction to outputs + movwf TRISB + bcf STATUS,RP0 ; select memory bank 0 + goto main +;; for this program use the 2k 8 bit mem chip, with WE on B2, OE on B3, and the memorys 3 least +;; sig bits to B4-B6 (inclusive), all other pins on the mem chip need to be held low, and an led +;; needs to be on B1 +;; when B1 goes high move the 3 pins from the microcontroler to leds and see the value +main: + movlw b'01111000' + movwf PORTB ; make we high, oe low, and 3 pins high + call wait1000ms + + movlw b'00000110' + movwf PORTB ; make we low, oe high, and 3 pins low + +noend: + goto noend + + END ; ends the program |