Skip to content

Instantly share code, notes, and snippets.

@droogie
Last active January 29, 2023 06:05
Show Gist options
  • Save droogie/a530e89290a720e0384941156f8451dd to your computer and use it in GitHub Desktop.
Save droogie/a530e89290a720e0384941156f8451dd to your computer and use it in GitHub Desktop.
AT89S53 IDA configuration for i51.cfg
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.AT89S53
; https://ww1.microchip.com/downloads/en/DeviceDoc/doc0787.pdf
;
; MEMORY MAP
area CODE code 0x0000:0x3000
area DATA RAM 0x0000:0x0100
area DATA FSR 0x0080:0x0100
entry extint0 0x0003 External interrupt 0 (INT0 / EX0)
entry timint0 0x000B Timer interrupt 0 (TIM0)
entry extint1 0x0013 External interrupt 1 (INT1 / EX1)
entry timint1 0x001B Timer interrupt 1 (TIM1)
entry serint 0x0023 Serial port interrupt (SERIAL)
entry timint2 0x002B Timer interrupt 2 (TIM2)
; INPUT/OUTPUT PORTS
P0 0x0080 Port 0
P0.P07 7
P0.P06 6
P0.P05 5
P0.P04 4
P0.P03 3
P0.P02 2
P0.P01 1
P0.P00 0
SP 0x0081 Stack Pointer
SP.SP7 7
SP.SP6 6
SP.SP5 5
SP.SP4 4
SP.SP3 3
SP.SP2 2
SP.SP1 1
SP.SP0 0
DP0L 0x0082 Data Pointer Low Byte
DP0H 0x0083 Data Pointer High Byte
DP1L 0x0084 Data Pointer 1 Low Byte
DP1H 0x0085 Data Pointer 1 High Byte
SPDR 0x0086 SPI Data Register
SPDR.SPD7 7
SPDR.SPD6 6
SPDR.SPD5 5
SPDR.SPD4 4
SPDR.SPD3 3
SPDR.SPD2 2
SPDR.SPD1 1
SPDR.SPD0 0
PCON 0x0087 Power Control Register
PCON.PDS 6
PCON.IDLS 5
PCON.GF1 3
PCON.GF0 2
PCON.PDE 1
PCON.IDLE 0
TCON 0x0088 Timer Control Register
TCON.TF1 7
TCON.TR1 6
TCON.TF0 5
TCON.TR0 4
TCON.IE1 3
TCON.IT1 2
TCON.IE0 1
TCON.IT0 0
TMOD 0x0089 Timer Mode Control Register
TMOD.GATE_1 7
TMOD.C_T_1 6
TMOD.M1_1 5
TMOD.M0_1 4
TMOD.GATE_0 3
TMOD.C_T_0 2
TMOD.M1_0 1
TMOD.M0_0 0
TL0 0x008A Timer 0 Low Byte
TL1 0x008B Timer 1 Low Byte
TH0 0x008c Timer 0 High Byte
TH1 0x008D Timer 1 High Byte
P1 0x0090 Port 1
WCON 0x0096 Watchdog Control Register
WCON.PS2 7
WCON.PS1 6
WCON.PS0 5
WCON.DPS 2
WCON.WDTRST 1
WCON.WDTEN 0
SCON 0x0098 Serial Port Control
SBUF 0x0099 Serial Port Buffer
P2 0x00A0 Port 2
IE 0x00A8 Interrupt Enable Register 0
IE.EA 7
IE.ET2 5
IE.ES 4
IE.ET1 3
IE.EX1 2
IE.ET0 1
IE.EX0 0
SPSR 0x00AA SPI Status Register
SPSR.SPIF 7
SPSR.WCOL 6
P3 0x00B0 Port 3
IP 0x00B8 Interrupt Priority Register
T2CON 0x00C8 Timer 2 Control
T2CON.TF2 7
T2CON.EXF2 6
T2CON.RCLK 5
T2CON.TCLK 4
T2CON.EXEN2 3
T2CON.TR2 2
T2CON.C_T_2 1
T2CON.CP_RL_2 0
T2MOD 0x00C9 Timer 2 Mode
RCAP2L 0x00CA Timer 2 Capture Low Byte
RCAP2H 0x00CB Timer 2 Capture High Byte
TL2 0x00CC Timer 2 Low Byte
TH2 0x00CD Timer 2 High Byte
PSW 0x00D0 Program Status Word
SPCR 0x00D5 SPI Control Register
SPCR.SPIE 7
SPCR.SPE 6
SPCR.DORD 5
SPCR.MSTR 4
SPCR.CPOL 3
SPCR.CPHA 2
SPCR.SPR1 1
SPCR.SPR0 0
ACC 0x00E0 Accumulator
ACC.ACC7 7 ACC.ACC6 6
ACC.ACC5 5
ACC.ACC4 4
ACC.ACC3 3
ACC.ACC2 2
ACC.ACC1 1
ACC.ACC0 0
B 0x00F0 B Register
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment