Skip to content

Instantly share code, notes, and snippets.

@vppillai
Created June 20, 2016 09:57
Show Gist options
  • Save vppillai/1485216f667db32a833138c8c78e586b to your computer and use it in GitHub Desktop.
Save vppillai/1485216f667db32a833138c8c78e586b to your computer and use it in GitHub Desktop.
movlw 0xf0 ; moving value 0xf0 to location 0x22 through w register
movwf 0x22
call rtn1 ; a jump instruction to label rtn1, pushes 03 (next PC)
; to stack and loads 05 (rtn1) to PC
movfw 0x24 ;moving value in location 0x24 to location 0x23 through
;w register
movwf 0x23
rtn1: movlw 0x8f ;moving value 0x8f to location 0x24 in data
movwf 0x24 ; memory
call rtn2 ;pushes 08 to stack and loads 11 to PC.
movlw 0xa0 ;moving value 0xa0 to location 0x24
addwf 0x24 ;adding the value 0xa0 to content of
;location 0x24
return ;pops 03 from stack and loads to PC
rtn2: movfw 0x24 ;moving content of location 0x24 to location 0x25
;through w register
movwf 0x25
return ; pops 08 from stack and loads it to to PC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment