summaryrefslogtreecommitdiff
path: root/electronics/asm/\
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2024-10-15 10:19:30 +0100
committerthing1 <thing1@seacrossedlovers.xyz>2024-10-15 10:19:30 +0100
commitfaef2d81c224b715c5e429d04c59ba50fb772d9e (patch)
tree2f75197a884ded3486c14e09908cb23bd24b968c /electronics/asm/\
parent3564e513623bb3fc4d528d3d29df9aa91dae1396 (diff)
added a stupid amount of work to zpy, and started the document work in latex
rather than groff
Diffstat (limited to 'electronics/asm/\')
-rw-r--r--electronics/asm/\45
1 files changed, 45 insertions, 0 deletions
diff --git a/electronics/asm/\ b/electronics/asm/\
new file mode 100644
index 0000000..c86ca8e
--- /dev/null
+++ b/electronics/asm/\
@@ -0,0 +1,45 @@
+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'00000000' ; set port A data direction to inputs
+ movwf TRISA
+ movlw b'00001111' ; set port B data direction to outputs
+ movwf TRISB
+ bcf STATUS,RP0 ; select memory bank 0
+
+ ;stackptr EQU B10
+ tmpdata EQU B9
+
+ goto main
+
+main:
+ ;movlw 0
+ ;movwf stackptr
+
+ movlw b'00000001'
+ movwf PORTA
+
+ movlw b'10100000' ; move 1111 to the output
+ movwf PORTB
+
+ movlw b'00000000'
+ movwf PORTA
+
+ movlw b'11111111'
+ movwf TRISB
+
+ movf PORTB, W
+ movwf tmpdata
+
+ movlw b'00001111'
+ movwf TRISB
+
+ swapf tmpdata, W
+ movwf PORTB
+
+noend:
+ goto noend
+
+ END ; ends the program