Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Mon Mar 30 15:05:50 NZDT 2020. Below worked. Practicing lbr and sep within pages 0,3.
- ;Sun Mar 29 15:49:01 NZDT 2020. Looking now at long branches into page1,2 and 3.
- 0000 START ORG 0
- 0000 7b seq
- 0001 7a req
- 0002 7b seq
- 0003 f8 00 ldi $00
- 0005 b2 phi 2 ;R2 is stack pointer
- 0006 f8 ff ldi $ff
- 0008 a2 plo 2 ;R2=stack pointer now points to $00ff
- 0009 e2 sex 2 ;X now pnts to R2, the stack pointer. 00ff
- 000a f8 03 ldi $03
- 000c b7 phi 7
- 000d f8 98 ldi $98
- 000f a7 plo 7 ;R7 contains aritrary pointer 0398
- 0010 f8 00 ldi HIGH(main)
- 0012 b3 phi 3
- 0013 f8 23 ldi LOW(main)
- 0015 a3 plo 3 ;R3 now points to main; becomes main prog counter.
- 0016 f8 03 ldi HIGH(uphere)
- 0018 b8 phi 8
- 0019 f8 13 ldi LOW(uphere)
- 001b a8 plo 8 ;r8 now contains uphere, code in page 3.
- 001c write
- 001c f8 b6 ldi $b6
- 001e 57 str 7
- 001f d3 sep 3
- 0020 f8 a4 ldi $a4 ;never get here
- 0022 57 str 7
- 0023 main
- 0023 f8 56 ldi $56 ;going stack this number
- 0025 73 stxd
- ; lbr uphere
- 0026 d8 sep 8 ;go to uphere
- 0027 back
- 0027 f8 d6 ldi $d6
- 0029 17 inc 7
- 002a 57 str 7
- 002b 00 idl
- 0313 ORG $313
- 0313 uphere
- ; nop
- ; nop
- 0313 17 inc 7
- 0314 f8 c6 ldi $c6
- 0316 57 str 7
- 0317 d3 sep 3 ;go back to main where we left off.
- 0318 c0 00 27 lbr back
- 031b 00 idl
- 03ff ORG 1023
- 03ff c4 nop
- ; seq
- 0400 END
- 0000 START 0027 back 0023 main 0313 uphere
- 001c write
Advertisement
Add Comment
Please, Sign In to add comment