prjbrook

experimentD.asm 1802 assembler

Mar 29th, 2020
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. ;Mon Mar 30 15:05:50 NZDT 2020. Below worked. Practicing lbr and sep within pages 0,3.
  2. ;Sun Mar 29 15:49:01 NZDT 2020. Looking now at long branches into page1,2 and 3.
  3. 0000 START ORG 0
  4. 0000 7b seq
  5. 0001 7a req
  6. 0002 7b seq
  7. 0003 f8 00 ldi $00
  8.  
  9. 0005 b2 phi 2 ;R2 is stack pointer
  10. 0006 f8 ff ldi $ff
  11. 0008 a2 plo 2 ;R2=stack pointer now points to $00ff
  12. 0009 e2 sex 2 ;X now pnts to R2, the stack pointer. 00ff
  13. 000a f8 03 ldi $03
  14. 000c b7 phi 7
  15. 000d f8 98 ldi $98
  16. 000f a7 plo 7 ;R7 contains aritrary pointer 0398
  17.  
  18. 0010 f8 00 ldi HIGH(main)
  19. 0012 b3 phi 3
  20. 0013 f8 23 ldi LOW(main)
  21. 0015 a3 plo 3 ;R3 now points to main; becomes main prog counter.
  22.  
  23. 0016 f8 03 ldi HIGH(uphere)
  24. 0018 b8 phi 8
  25. 0019 f8 13 ldi LOW(uphere)
  26. 001b a8 plo 8 ;r8 now contains uphere, code in page 3.
  27. 001c write
  28. 001c f8 b6 ldi $b6
  29. 001e 57 str 7
  30. 001f d3 sep 3
  31. 0020 f8 a4 ldi $a4 ;never get here
  32. 0022 57 str 7
  33. 0023 main
  34. 0023 f8 56 ldi $56 ;going stack this number
  35. 0025 73 stxd
  36. ; lbr uphere
  37. 0026 d8 sep 8 ;go to uphere
  38. 0027 back
  39. 0027 f8 d6 ldi $d6
  40. 0029 17 inc 7
  41. 002a 57 str 7
  42. 002b 00 idl
  43.  
  44. 0313 ORG $313
  45. 0313 uphere
  46. ; nop
  47. ; nop
  48. 0313 17 inc 7
  49. 0314 f8 c6 ldi $c6
  50. 0316 57 str 7
  51. 0317 d3 sep 3 ;go back to main where we left off.
  52. 0318 c0 00 27 lbr back
  53. 031b 00 idl
  54. 03ff ORG 1023
  55. 03ff c4 nop
  56. ; seq
  57.  
  58. 0400 END
  59. 0000 START 0027 back 0023 main 0313 uphere
  60. 001c write
Advertisement
Add Comment
Please, Sign In to add comment