Advertisement
adolf01

Untitled

Mar 18th, 2019
719
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lcd_inst = &7800 ;
  2. lcd_data = lcd_inst + 1 ;
  3.  
  4.  
  5.  
  6.  
  7.  
  8. ORG &8000
  9. .start_here
  10.  
  11. JSR LINIT
  12.  
  13. JSR lcd_move_right
  14.  
  15.  
  16. LDA #$50
  17. STA lcd_data
  18. LDA #$72
  19. STA lcd_data
  20. LDA #$6F
  21. STA lcd_data
  22. LDA #$6A
  23. STA lcd_data
  24. LDA #$65
  25. STA lcd_data
  26. LDA #$63
  27. STA lcd_data
  28. LDA #$74
  29. STA lcd_data
  30.  
  31. JSR lcd_move_right
  32.  
  33. LDA #$36
  34. STA lcd_data
  35. LDA #$35
  36. STA lcd_data
  37.  
  38.  
  39. .loop
  40. bne loop
  41.  
  42. ; *** LCD initialisation
  43. .LINIT     ;LDX #$04            ;do function set 4 times
  44.  
  45. .LINIT0    LDA #$38            ;function set: 8 bit, 2 lines, 5x7
  46.           STA lcd_inst
  47.          
  48.           ;DEX
  49.           ;BNE LINIT0
  50.           LDA #$06            ;entry mode set: increment, no shift
  51.           STA lcd_inst
  52.          
  53.           LDA #$0E            ;display on, cursor on, blink off
  54.           STA lcd_inst
  55.          
  56.           LDA #$01            ;clear display
  57.           STA lcd_inst
  58.          
  59.           LDA #$80            ;DDRAM address set: $00
  60.           STA lcd_inst
  61.           RTS
  62.          
  63. .lcd_move_left  LDA #$10
  64.                 STA lcd_inst
  65.                 RTS
  66.                
  67. .lcd_move_right LDA #$14
  68.                 STA lcd_inst
  69.                 RTS
  70.                
  71. .lcd_print_g    LDA #$47
  72.                 STA lcd_data
  73.                 RTS
  74.        
  75. ORG &FFFA
  76.             equw      start_here       ; NMI address
  77.             equw      start_here       ; RESET address
  78.             equw      start_here       ; IRQ address
  79.    
  80. .end   
  81.    
  82. save "lcd.hex", start_here, end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement