??? 04/08/09 06:47 Read: times |
#164473 - LST output of my previously posted code Responding to: ???'s previous message |
Dear Gopal,
The previously posted 'c' code is compiled using SDCC ver 2.4.0 here is how .LST file is generated 291 ;-------------------------------------------------------- 292 .area CSEG (CODE) 293 ;------------------------------------------------------------ 294 ;Allocation info for local variables in function 'init_8255' 295 ;------------------------------------------------------------ 296 ;control_word Allocated to registers r2 297 ;------------------------------------------------------------ 298 ;mem.c:9: void init_8255(unsigned char control_word) 299 ; ----------------------------------------- 300 ; function init_8255 301 ; ----------------------------------------- 0000 302 _init_8255: 0002 303 ar2 = 0x02 0003 304 ar3 = 0x03 0004 305 ar4 = 0x04 0005 306 ar5 = 0x05 0006 307 ar6 = 0x06 0007 308 ar7 = 0x07 0000 309 ar0 = 0x00 0001 310 ar1 = 0x01 0000 C0*00 311 push _bp 0002 85 81*00 312 mov _bp,sp 313 ; genReceive 0005 AA 82 314 mov r2,dpl 315 ;mem.c:11: ptr_8255 = MY_8255_BASE; 316 ; genAssign 0007 90s00r00 317 mov dptr,#_ptr_8255 000A 74 00 318 mov a,#_MY_8255_BASE 000C F0 319 movx @dptr,a 000D A3 320 inc dptr 000E 74 40 321 mov a,#(_MY_8255_BASE >> 8) 0010 F0 322 movx @dptr,a 0011 A3 323 inc dptr 0012 74 01 324 mov a,#0x01 0014 F0 325 movx @dptr,a 326 ;mem.c:12: *(ptr_8255 + 3) = control_word; 327 ; genPointerSet 328 ; genGenPointerSet 0015 90 40 03 329 mov dptr,#(_MY_8255_BASE + 0x0003) 0018 75 F0 01 330 mov b,#0x01 001B EA 331 mov a,r2 001C 12s00r00 332 lcall __gptrput 001F 333 00101$: 001F 85*00 81 334 mov sp,_bp 0022 D0*00 335 pop _bp 0024 22 336 ret 337 .area CSEG (CODE) 338 .area XINIT (CODE) Regards, Mahesh |
Topic | Author | Date |
How to access memory mapped 8255 with SDCC? | 01/01/70 00:00 | |
also asked here: | 01/01/70 00:00 | |
8255 with SDCC | 01/01/70 00:00 | |
Wrong question? | 01/01/70 00:00 | |
It's C | 01/01/70 00:00 | |
not on the 8051 | 01/01/70 00:00 | |
Oh yes it is! | 01/01/70 00:00 | |
Use XBYTE macro | 01/01/70 00:00 | |
Isn't there a problem with that? | 01/01/70 00:00 | |
Oops. I used a wrong example | 01/01/70 00:00 | |
Portability | 01/01/70 00:00 | |
like this... | 01/01/70 00:00 | |
How about a macro in ASM, callable from 'C'? | 01/01/70 00:00 | |
This is HOW I will Prefer | 01/01/70 00:00 | |
LST output of my previously posted code | 01/01/70 00:00 | |
Try the comparison | 01/01/70 00:00 | |
Unnecessarily complicated! | 01/01/70 00:00 | |
NOT UNNECESSARILY | 01/01/70 00:00 | |
You are mistaken | 01/01/70 00:00 | |
Array or pointer similar | 01/01/70 00:00 | |
That should not be necessary | 01/01/70 00:00 | |
SFRX(...,. ..) worked | 01/01/70 00:00 | |
SFRX - presumably, that's an SDCC extension? | 01/01/70 00:00 | |
Found it! | 01/01/70 00:00 | |
RE: Found it!![]() | 01/01/70 00:00 |