Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/28/05 11:03
Read: times


 
#106076 - definitions for 2500 A.D Software
Responding to: ???'s previous message
hi,

Shaharyar Ali Anis said:
im writing code for at89s8252


So first of all include the next line at the top of your .asm file:
        CHIP    8052            
By this line your assembler will be noted about using of 8052 extra features like additional 128 bytes of memory and timer 2.
Rest registers and bits may be defined with keyword REG. Here is example of my very old program wrote under 2500 A.D.
        CHIP    8052            ; Extensions of 8052
;---------------------------------------------------------;
; additional registers of 89S8252:
DP0L    REG     82h             ; DATA POINTER 0 - LOW BYTE
DP0H    REG     83h             ; DATA POINTER 0 - HIGH BYTE
DP1L    REG     84h             ; DATA POINTER 1 - LOW BYTE
DP1H    REG     85h             ; DATA POINTER 1 - HIGH BYTE
WMCON   REG     96h             ; WATCHDOG AND MEMORY CONTROL REGISTER
T2MOD   REG     C9h             ; TIMER 2 MODE CONTROL REGISTER
EEMWE   EQU     00010000b       ; EEPROM Data Memory Write Enable bit
EEMEN   EQU     00001000b       ; EEPROM Access Enable
DPS     EQU     00000100b       ; Data Pointer Register Select
WDTRST  EQU     00000010b       ; Watchdog Timer Reset / EEPROM Ready Flag
WDTEN   EQU     00000001b       ; Watchdog Timer Enable bit
;---------------------------------------------------------;
; memory allocations
BUTTONS EQU     2Eh     ; keyboard status 
TMP_BF  EQU     2Fh     ; temp. bitfield
BIT_TRE REG     2Fh.0   ; TIMER REFRESH ENABLE
BIT_T0R REG     2Fh.1   ; TIMER 0 READY
BIT_WKE REG     2Fh.2   ; WRITE KEY ENABLE

;---------------------------------------------------------;
; EEPROM
USG_CNT EQU     0010h   ; log base address 

;---------------------------------------------------------;
; Ports
KBD_DAT REG     P0      ; keyboard port
; buttons
BUT_1   REG     P0.5    ; ones
BUT_10  REG     P0.4    ; tens
BUT_WR  REG     P0.6    ; write

HGL_DAT REG     P1      ; LED segments
; LED1
HGL_1_A REG     P1.3    ; segment A
HGL_1_B REG     P1.0    ; segment B
HGL_1_C REG     P1.4    ; segment C
HGL_1_D REG     P1.2    ; segment D
HGL_1_E REG     P1.1    ; segment E
HGL_1_F REG     P1.6    ; segment F
HGL_1_G REG     P1.5    ; segment G
;---------------------------------------------------------;
; my defines
F1      REG     PSW.1
T0_50HZ         EQU     B0h             ; B000h - timer 0 divider for 50Hz
; keyboard
KBD_MASK        EQU     01110000b       ; keyboard mask for 3 buttons
KBD_WR_MASK     EQU     01000000b       ; mask for write button
KBD_01_MASK     EQU     00100000b       ; mask for button +1
KBD_10_MASK     EQU     00010000b       ; mask for button +10
MAX_USAGE_VALUE EQU     256-50          ; max. number of writes

; error codes
ERROR_MB_UNKNOWN        EQU     1
ERROR_WRONG_MCU         EQU     2
ERROR_WRONG_CRC         EQU     3
ERROR_WRONG_ID          EQU     4
ERROR_EEPROM_BAD        EQU     5
etc.
I think this example gives you hints how to do.

Regards,
Oleg

List of 23 messages in thread
TopicAuthorDate
Assmbler help            01/01/70 00:00      
   ?            01/01/70 00:00      
   Re: Assembler help            01/01/70 00:00      
      usually not            01/01/70 00:00      
   just caught the above            01/01/70 00:00      
   Any 8052 assembly compiler            01/01/70 00:00      
      assembly compiler there is no such thin            01/01/70 00:00      
      MetaLink among others            01/01/70 00:00      
         MetaLink among others            01/01/70 00:00      
            Excellent documentation            01/01/70 00:00      
      The Include files            01/01/70 00:00      
         Im using x51 L51            01/01/70 00:00      
            when using an oddball (not that that is            01/01/70 00:00      
            ????            01/01/70 00:00      
               ur brand name            01/01/70 00:00      
                  2500 A.D Software - dead by now?            01/01/70 00:00      
                  Old Compiler            01/01/70 00:00      
                  if you do not have the manual, that seem            01/01/70 00:00      
                     The old days            01/01/70 00:00      
                        OT: Floppies            01/01/70 00:00      
            Re:            01/01/70 00:00      
   definitions for 2500 A.D Software            01/01/70 00:00      
   Thankyou All            01/01/70 00:00      

Back to Subject List