1 ;-------------------------------------------------------- 2 ; File Created by SDCC : FreeWare ANSI-C Compiler 3 ; Version 2.3.1 Wed Jul 8 08:36:18 2020 4 5 ;-------------------------------------------------------- 6 .module lcc2232240 7 8 ;-------------------------------------------------------- 9 ; Public variables in this module 10 ;-------------------------------------------------------- 11 .globl _main 12 .globl _printAndWait 13 ;-------------------------------------------------------- 14 ; special function registers 15 ;-------------------------------------------------------- 16 ;-------------------------------------------------------- 17 ; special function bits 18 ;-------------------------------------------------------- 19 ;-------------------------------------------------------- 20 ; internal ram data 21 ;-------------------------------------------------------- 22 .area _DATA 23 ;-------------------------------------------------------- 24 ; overlayable items in internal ram 25 ;-------------------------------------------------------- 26 .area _OVERLAY 27 ;-------------------------------------------------------- 28 ; indirectly addressable internal ram data 29 ;-------------------------------------------------------- 30 .area _ISEG 31 ;-------------------------------------------------------- 32 ; bit data 33 ;-------------------------------------------------------- 34 .area _BSEG 35 ;-------------------------------------------------------- 36 ; external ram data 37 ;-------------------------------------------------------- 38 .area _XSEG 39 ;-------------------------------------------------------- 40 ; global & static initialisations 41 ;-------------------------------------------------------- 42 .area _GSINIT 43 .area _GSFINAL 44 .area _GSINIT 45 ;-------------------------------------------------------- 46 ; Home 47 ;-------------------------------------------------------- 48 .area _HOME 49 .area _CODE 50 ;-------------------------------------------------------- 51 ; code 52 ;-------------------------------------------------------- 53 .area _CODE 54 ; input_state.c 4 55 ; genLabel 56 ; genFunction 57 ; --------------------------------- 58 ; Function printAndWait 59 ; --------------------------------- 0000 60 ___printAndWait_start: 0000 61 _printAndWait: 62 63 ; input_state.c 5 64 ; genIpush 65 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 66 ; AOP_STK for 0000 F8 02 67 lda hl,2(sp) 0002 2A 68 ld a,(hl+) 0003 66 69 ld h,(hl) 0004 6F 70 ld l,a 0005 E5 71 push hl 72 ; genCall 0006 CD 00 00 73 call _printf 0009 E8 02 74 lda sp,2(sp) 75 ; input_state.c 6 76 ; genIpush 77 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 000B 21 64 00 78 ld hl,#0x0064 000E E5 79 push hl 80 ; genCall 000F CD 00 00 81 call _delay 0012 E8 02 82 lda sp,2(sp) 83 ; genLabel 0014 84 00101$: 85 ; genEndFunction 86 0014 C9 87 ret 0015 88 ___printAndWait_end: 89 ; input_state.c 9 90 ; genLabel 91 ; genFunction 92 ; --------------------------------- 93 ; Function main 94 ; --------------------------------- 0015 95 ___main_start: 0015 96 _main: 97 98 ; input_state.c 10 99 ; genLabel 0015 100 00111$: 101 ; input_state.c 11 102 ; genCall 103 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0015 CD 00 00 104 call _joypad 0018 4B 105 ld c,e 106 ; genCmpEq 107 ; genCmpEq: left 1, right 1, result 0 0019 79 108 ld a,c 001A FE 01 109 cp a,#0x01 001C CA 58 00 110 jp z,00102$ 001F 111 00124$: 112 ; genCmpEq 113 ; genCmpEq: left 1, right 1, result 0 001F 79 114 ld a,c 0020 FE 02 115 cp a,#0x02 0022 CA 4C 00 116 jp z,00101$ 0025 117 00125$: 118 ; genCmpEq 119 ; genCmpEq: left 1, right 1, result 0 0025 79 120 ld a,c 0026 FE 04 121 cp a,#0x04 0028 CA 64 00 122 jp z,00103$ 002B 123 00126$: 124 ; genCmpEq 125 ; genCmpEq: left 1, right 1, result 0 002B 79 126 ld a,c 002C FE 08 127 cp a,#0x08 002E CA 70 00 128 jp z,00104$ 0031 129 00127$: 130 ; genCmpEq 131 ; genCmpEq: left 1, right 1, result 0 0031 79 132 ld a,c 0032 FE 10 133 cp a,#0x10 0034 CA 94 00 134 jp z,00107$ 0037 135 00128$: 136 ; genCmpEq 137 ; genCmpEq: left 1, right 1, result 0 0037 79 138 ld a,c 0038 FE 20 139 cp a,#0x20 003A CA A0 00 140 jp z,00108$ 003D 141 00129$: 142 ; genCmpEq 143 ; genCmpEq: left 1, right 1, result 0 003D 79 144 ld a,c 003E FE 40 145 cp a,#0x40 0040 CA 88 00 146 jp z,00106$ 0043 147 00130$: 148 ; genCmpEq 149 ; genCmpEq: left 1, right 1, result 0 0043 79 150 ld a,c 0044 FE 80 151 cp a,#0x80 0046 CA 7C 00 152 jp z,00105$ 0049 153 00131$: 154 ; genGoto 0049 C3 15 00 155 jp 00111$ 156 ; input_state.c 13 157 ; genLabel 004C 158 00101$: 159 ; genIpush 160 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 004C 21 AD 00 161 ld hl,#__str_0 004F E5 162 push hl 163 ; genCall 0050 CD 00 00 164 call _printAndWait 0053 E8 02 165 lda sp,2(sp) 166 ; input_state.c 14 167 ; genGoto 0055 C3 15 00 168 jp 00111$ 169 ; input_state.c 16 170 ; genLabel 0058 171 00102$: 172 ; genIpush 173 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0058 21 B4 00 174 ld hl,#__str_1 005B E5 175 push hl 176 ; genCall 005C CD 00 00 177 call _printAndWait 005F E8 02 178 lda sp,2(sp) 179 ; input_state.c 17 180 ; genGoto 0061 C3 15 00 181 jp 00111$ 182 ; input_state.c 19 183 ; genLabel 0064 184 00103$: 185 ; genIpush 186 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0064 21 BC 00 187 ld hl,#__str_2 0067 E5 188 push hl 189 ; genCall 0068 CD 00 00 190 call _printAndWait 006B E8 02 191 lda sp,2(sp) 192 ; input_state.c 20 193 ; genGoto 006D C3 15 00 194 jp 00111$ 195 ; input_state.c 22 196 ; genLabel 0070 197 00104$: 198 ; genIpush 199 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0070 21 C1 00 200 ld hl,#__str_3 0073 E5 201 push hl 202 ; genCall 0074 CD 00 00 203 call _printAndWait 0077 E8 02 204 lda sp,2(sp) 205 ; input_state.c 23 206 ; genGoto 0079 C3 15 00 207 jp 00111$ 208 ; input_state.c 25 209 ; genLabel 007C 210 00105$: 211 ; genIpush 212 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 007C 21 C8 00 213 ld hl,#__str_4 007F E5 214 push hl 215 ; genCall 0080 CD 00 00 216 call _printAndWait 0083 E8 02 217 lda sp,2(sp) 218 ; input_state.c 26 219 ; genGoto 0085 C3 15 00 220 jp 00111$ 221 ; input_state.c 28 222 ; genLabel 0088 223 00106$: 224 ; genIpush 225 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0088 21 D0 00 226 ld hl,#__str_5 008B E5 227 push hl 228 ; genCall 008C CD 00 00 229 call _printAndWait 008F E8 02 230 lda sp,2(sp) 231 ; input_state.c 29 232 ; genGoto 0091 C3 15 00 233 jp 00111$ 234 ; input_state.c 31 235 ; genLabel 0094 236 00107$: 237 ; genIpush 238 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 0094 21 D9 00 239 ld hl,#__str_6 0097 E5 240 push hl 241 ; genCall 0098 CD 00 00 242 call _printAndWait 009B E8 02 243 lda sp,2(sp) 244 ; input_state.c 32 245 ; genGoto 009D C3 15 00 246 jp 00111$ 247 ; input_state.c 34 248 ; genLabel 00A0 249 00108$: 250 ; genIpush 251 ; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 00A0 21 DD 00 252 ld hl,#__str_7 00A3 E5 253 push hl 254 ; genCall 00A4 CD 00 00 255 call _printAndWait 00A7 E8 02 256 lda sp,2(sp) 257 ; input_state.c 36 258 ; genGoto 00A9 C3 15 00 259 jp 00111$ 260 ; genLabel 00AC 261 00113$: 262 ; genEndFunction 263 00AC C9 264 ret 00AD 265 ___main_end: 00AD 266 __str_0: 00AD 4C 65 66 74 21 267 .ascii "Left!" 00B2 0A 268 .db 0x0A 00B3 00 269 .db 0x00 00B4 270 __str_1: 00B4 52 69 67 68 74 21 271 .ascii "Right!" 00BA 0A 272 .db 0x0A 00BB 00 273 .db 0x00 00BC 274 __str_2: 00BC 55 70 21 275 .ascii "Up!" 00BF 0A 276 .db 0x0A 00C0 00 277 .db 0x00 00C1 278 __str_3: 00C1 44 6F 77 6E 21 279 .ascii "Down!" 00C6 0A 280 .db 0x0A 00C7 00 281 .db 0x00 00C8 282 __str_4: 00C8 53 74 61 72 74 21 283 .ascii "Start!" 00CE 0A 284 .db 0x0A 00CF 00 285 .db 0x00 00D0 286 __str_5: 00D0 53 65 6C 65 63 74 287 .ascii "Select!" 21 00D7 0A 288 .db 0x0A 00D8 00 289 .db 0x00 00D9 290 __str_6: 00D9 41 21 291 .ascii "A!" 00DB 0A 292 .db 0x0A 00DC 00 293 .db 0x00 00DD 294 __str_7: 00DD 42 21 295 .ascii "B!" 00DF 0A 296 .db 0x0A 00E0 00 297 .db 0x00 298 .area _CODE ASxxxx Assembler V01.75 (GameBoy Z80-like CPU), page 1. Symbol Table 0 ___main_end 00AD R 0 ___main_start 0015 R 0 ___printAndWait_end 0015 R 0 ___printAndWait_start 0000 R 0 __str_0 00AD R 0 __str_1 00B4 R 0 __str_2 00BC R 0 __str_3 00C1 R 0 __str_4 00C8 R 0 __str_5 00D0 R 0 __str_6 00D9 R 0 __str_7 00DD R _delay **** GX _joypad **** GX 0 _main 0015 GR 0 _printAndWait 0000 GR _printf **** GX ASxxxx Assembler V01.75 (GameBoy Z80-like CPU), page 2. Area Table 0 _CODE size E1 flags 0 1 _DATA size 0 flags 0 2 _OVERLAY size 0 flags 0 3 _ISEG size 0 flags 0 4 _BSEG size 0 flags 0 5 _XSEG size 0 flags 0 6 _GSINIT size 0 flags 0 7 _GSFINAL size 0 flags 0 8 _HOME size 0 flags 0