andyp73

Amended assembler

Aug 20th, 2021 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. switch_on:
  2. /* Send the command to the EC to turn the keyboard backlight on */
  3. movw $0x66, %dx
  4. 1:
  5. inb %dx, %al /* Wait for IBF == 0 */
  6. andb $0x02, %al
  7. jnz 1b
  8.  
  9. movb $0x81, %al /* Send EC write command */
  10. outb %al, %dx
  11.  
  12. 2:
  13. inb %dx, %al /* Wait for IBF == 0 */
  14. andb $0x02, %al
  15. jnz 2b
  16.  
  17. movb $0x19, %al /* Register 0x19 */
  18. movw $0x62, %dx
  19. outb %al, %dx
  20.  
  21. movw $0x66, %dx
  22. 3:
  23. inb %dx, %al /* Wait for IBF == 0 */
  24. andb $0x02, %al
  25. jnz 3b
  26.  
  27. movb $0xee, %al /* Value 0xee */
  28. movw $0x62, %dx
  29. outb %al, %dx
  30.  
  31. /* Delay for a while */
  32. movl $0x00010000, %ecx
  33. wait1:
  34. nop
  35. loop wait1
Add Comment
Please, Sign In to add comment