Game & Watch: The Legend of Zelda >> Assembly

LCD Backlight


參考資訊:
1. pm_pdf
2. ds_pdf
3. game-and-watch-backup
4. game-and-watch-hardware
5. game-and-watch-flashloader

LCD背光電路


main.s

  .equiv PORTA_BASE,  0x58020000
  .equiv GPIO_MODER,  0x0000
  .equiv GPIO_ODR,    0x0014
 
  .equiv RCC_BASE,    0x58024400
  .equiv RCC_AHB4ENR, 0x0140
 
  .thumb
  .cpu cortex-m7
  .syntax unified
 
  .global _start
 
  .text
  .org 0x0000
_start:
  .word 0x20020000
  .word reset
 
  .org 0x0100
  .thumb_func
reset:
  ldr r0, =RCC_BASE
  ldr r1, [r0, #RCC_AHB4ENR]
  orr r1, #0x1f
  str r1, [r0, #RCC_AHB4ENR]
 
  ldr r0, =PORTA_BASE
  ldr r1, =0xa9555555
  str r1, [r0, #GPIO_MODER]
  ldr r1, =0x0000
  str r1, [r0, #GPIO_ODR]
 
  ldr r3, =(1 << 6) | (1 << 5) | (1 << 4)
0:
  eor r1, r3
  str r1, [r0, #GPIO_ODR]
  ldr r2, =0x2000000
1:
  subs r2, #1
  bne 1b
  b 0b
  .end

完成


返回上一頁