cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

shift.s (1553B)


      1        .module shift
      2
      3        .area   _HOME
      4
      5        ;;
      6__rrulong_rrx_s::                
      7        ld      hl,#2
      8        add     hl,sp
      9
     10        ld      a,(hl+)
     11        ld      e, a
     12        ld      a,(hl+)
     13        ld      d, a
     14        ld      a,(hl+)
     15        ld      c, a
     16        ld      a,(hl+)
     17        ld      b, a
     18        ld      a,(hl)
     19
     20        ld      l,c
     21        ld      h,b
     221$:
     23        or      a,a
     24        ret     z
     25
     26        rr      h
     27        rr      l
     28        rr      d
     29        rr      e
     30
     31        dec     a
     32        jp      1$
     33
     34__rrslong_rrx_s::        
     35        ld      hl,#2
     36        add     hl,sp
     37                
     38        ld      a,(hl+)
     39        ld      e, a
     40        ld      a,(hl+)
     41        ld      d, a
     42        ld      a,(hl+)
     43        ld      c, a
     44        ld      a,(hl+)
     45        ld      b, a
     46        ld      a,(hl)
     47
     48        ld      l,c
     49        ld      h,b
     501$:
     51        or      a,a
     52        ret     z
     53
     54        sra     h
     55        rr      l
     56        rr      d
     57        rr      e
     58
     59        dec     a
     60        jp      1$
     61        
     62__rlslong_rrx_s::                
     63__rlulong_rrx_s::                
     64        ld      hl,#2
     65        add     hl,sp
     66        
     67        ld      a,(hl+)
     68        ld      e, a
     69        ld      a,(hl+)
     70        ld      d, a
     71        ld      a,(hl+)
     72        ld      c, a
     73        ld      a,(hl+)
     74        ld      b, a
     75        ld      a,(hl)
     76
     77        ld      l,c
     78        ld      h,b
     791$:
     80        or      a,a
     81        ret     z
     82
     83        rl      e
     84        rl      d
     85        rl      l
     86        rl      h
     87
     88        dec     a        
     89        jp      1$