| d52 -d program |
| d52 -db program | for the file program.bin, or | ||||||||
| d52 -dh program | for the file program.hex |
| (opcode/operands) | (address) | (data) | (ascii) | |||||
| orl a,#42h | ; 0df6 | 44 42 | DB |
| d52 -db filename |
| d52 /d /b filename |
| d52 /db filename -x1000 | |||||
| d52 filename -d b x1000 | |||||
| d52 -d filename bx1000 |
| (opcode/operands) | (address) | (data) | (ascii) | |||||
| orl a,#42h | ; 0df6 | 44 42 | DB |
include "sfr52.inc"
| d52 -d rom1 |
| d52 -d rom2 x1000 |
| Label | 0 | reset | and | ||||||||||||||||||||
| looney | 0 | reset |
| mov | r2,#data |
| mov | dptr,#data |
| t 1000 | the data at address 1000H is ascii text. | |||||||||||
| t 1000-1010 | the data from address 1000H to (and including) address 1010H is ascii text. | |||||||||||
| t 1000+6 | ascii text starting at 1000H for 6 bytes. |
| a 1000-1007 |
| dw | vec1 | |||||||||
| dw | vec2 | |||||||||
| dw | vec3 | |||||||||
| dw | vec4 |
| b 1000-1007 |
| db | 0,1,2,3,4,5,6,7 |
| d address [0 or label] | search label table only | |||||||||
| d address [1 or symbol] | search symbol table only | |||||||||
| d address [2 or none] | don't search either table |
| mov dptr,#1234 |
| d 1 address |
| f ef newreg |
| mov | newreg,a |
| mov | 0efh,a |
| i c00-fff |
| k ae newint | (ae is the address of IE.6) |
| l 43 start |
| ajmp | start |
| ajmp | X0043 |
| m 12 bitflag | (12h is the bit address of 22h.2) |
| setb | bitflag |
| setb | 22h.2 |
| mov | rb2r5,a |
| r 15 loop |
| mov | loop,a |
| s 20 space |
| mov | a,#20h |
| mov | a,#space |
| mov | a,#20h |
| mov | dptr,#1234h |
| db | 'Hi there' | or | |||||||||||||||
| ascii | 'Hi there' | (command line option A used) |
| t 1000-1007 |
| orl | a,r0 | ; 1000 | 48 | H | |||||||||||||||||||
| xrl | a,r1 | ; 1001 | 69 | i | |||||||||||||||||||
| jb | 2eh.4,X106d | ; 1002 | 20 74 68 | th | |||||||||||||||||||
| xrl | a,72h | ; 1005 | 65 72 | er | |||||||||||||||||||
| xrl | a,t3 | ; 1007 | 65 ff | e. |
| w 1000-1007 |
| dw | 0 | |||||||||
| dw | 1 | |||||||||
| dw | 2 | |||||||||
| dw | 3 |
| X 102 loopinit |
| mov | r0,#loopinit |
| mov | r0,#CR |
# 95
# 95 Start of initialization
# 95
;
; Start of initialization
;
clr ea ;0095 c2 af B/
! 95 Start of initialization
clr ea ;0095 c2 af B/ ; Start of initialization
| org | 30h | |||||||
| main | mov | a,30h | ||||||
| mov | 30h,r0 | |||||||
| mov | r1,#30h | |||||||
| sjmp | main | |||||||
| end |
| l 30 | main | ; label for code address | |
| x 33 | thirty | ; name for operand at address 33h | |
| s 30 | alsothirty | ; symbol for immediate operand | |
| r 30 | counter | ; name for data memory address (register) at 30h |
| ; | ||||||||
| org | 30h | |||||||
| ; | ||||||||
| main: | mov | a,counter | ; 0030 e5 30 | e0 | ||||
| mov | thirty,r0 | ; 0032 88 30 | .0 | |||||
| mov | r1,#alsothirty | ; 0034 79 30 | y0 | |||||
| sjmp | main | ; 0036 80 f8 | .x | |||||
| ; | ||||||||
| counter | equ | 30h | ||||||
| alsothirty | equ | 30h | ||||||
| thirty | equ | 30h | ||||||
| ; | ||||||||
| end | ||||||||
| ; |
| LABEL: | OPCODE | OPERANDS | ; COMMENT |
| X004f: | orl | p3,#0ffh | ; 004f | 43 b0 ff | C0. | ||||||||||||||||||||
| label | opcode | operands | comment |
| what: | orl | p3,#0ffh | ; 004f | 43 b0 ff | C0. |
| what: | orl | p3,#ones | ; 004f | 43 b0 ff | C0. |
| Bank | R0 | R1 | R2 | R3 | R4 | R5 | R6 | R7 |
|---|---|---|---|---|---|---|---|---|
| 0 | 00 | 01 | 02 | 03 | 04 | 05 | 06 | 07 |
| 1 | 08 | 09 | 0A | 0B | 0C | 0D | 0E | 0F |
| 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 3 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F |
| Address | Symbol | Name |
|---|---|---|
| 80 | P0 | Port 0 |
| 81 | SP | Stack Pointer |
| 82 | DPL | Data Pointer (low byte) |
| 83 | DPH | Data Pointer (high byte) |
| 87 | PCON | Power Control |
| 88 | TCON | Timer/Counter Control |
| 89 | TMOD | Timer/Counter Mode |
| 8A | TL0 | Timer/Counter 0 (low byte) |
| 8B | TL1 | Timer/Counter 1 (low byte) |
| 8C | TH0 | Timer/Counter 0 (high byte) |
| 8D | TH1 | Timer/Counter 1 (high byte) |
| 90 | P1 | Port 1 |
| 98 | SCON | Serial Port Control |
| 99 | SBUF | Serial Data Buffer |
| A0 | P2 | Port 2 |
| A8 | IE | Interrupt Enable |
| B0 | P3 | Port 3 |
| B8 | IP | Interrupt Priority |
| D0 | PSW | Program Status Word |
| E0 | ACC | Accumulator |
| F0 | B | B Register |
| Address | Symbol | Bit name | Function |
|---|---|---|---|
| 80-87 | P0.0-7 | Port 0 | |
| 88 | IT0 | TCON.0 | External Interrupt 0 Type Control |
| 89 | IE0 | TCON.1 | External Interrupt 0 Edge Control |
| 8A | IT1 | TCON.2 | External Interrupt 1 Type Control |
| 8B | IE1 | TCON.3 | External Interrupt 1 Edge Control |
| 8C | TR0 | TCON.4 | Timer 0 Run Control |
| 8D | TF0 | TCON.5 | Timer 0 Overflow Flag |
| 8E | TR1 | TCON.6 | Timer 1 Run Control |
| 8F | TF1 | TCON.7 | Timer 1 Overflow Flag |
| 90-97 | P1.0-7 | Port 1 | |
| 98 | RI | SCON.0 | Serial Receive Interrupt Flag |
| 99 | TI | SCON.1 | Serial Transmit Interrupt Flag |
| 9A | RB8 | SCON.2 | Serial Receive Bit 8 |
| 9B | TB8 | SCON.3 | Serial Transmit Bit 8 |
| 9C | REN | SCON.4 | Serial Receive Enable |
| 9D | SM2 | SCON.5 | Serial Port Mode Specifier |
| 9E | SM1 | SCON.6 | Serial Port Mode Specifier |
| 9F | SM0 | SCON.7 | Serial Port Mode Specifier |
| A0-A7 | P2.0-7 | Port 2 | |
| A8 | EX0 | IE.0 | Enable External Interrupt 0 |
| A9 | ET0 | IE.1 | Enable Timer 0 Interrupt |
| AA | EX1 | IE.2 | Enable External Interrupt 1 |
| AB | ET1 | IE.3 | Enable Timer 1 Interrupt |
| AC | ES | IE.4 | Enable Serial Port Interrupt |
| AF | EA | IE.7 | Enable Interrupts |
| B0-B7 | P3.0-7 | Port 3 | |
| B8 | PX0 | IP.0 | External Interrupt 0 Priority |
| B9 | PT0 | IP.1 | Timer 0 Interrupt Priority |
| BA | PX1 | IP.2 | External Interrupt 1 Priority |
| BB | PT1 | IP.3 | Timer 1 Interrupt Priority |
| BC | PS | IP.4 | Serial Port Interrupt Priority |
| D0 | P | PSW.0 | Parity |
| D2 | OV | PSW.2 | Overflow Flag |
| D3 | RS0 | PSW.3 | Register Bank Select Bit 0 |
| D4 | RS1 | PSW.4 | Register Bank Select Bit 1 |
| D5 | F0 | PSW.5 | Flag 0 (general purpose flag) |
| D6 | AC | PSW.6 | Auxiliary Carry Flag |
| D7 | CY | PSW.7 | Carry Flag |
| E0-E7 | ACC.0-7 | Accumulator Bits | |
| F0-F7 | B.0-7 | B Register Bits |
| Address | Memory location |
|---|---|
| 00-07 | 20.0 - 20.7 |
| 08-0F | 21.0 - 21.7 |
| 10-17 | 22.0 - 22.7 |
| 18-1F | 23.0 - 23.7 |
| 20-27 | 24.0 - 24.7 |
| 28-2F | 25.0 - 25.7 |
| 30-37 | 26.0 - 26.7 |
| 38-3F | 27.0 - 27.7 |
| 40-47 | 28.0 - 28.7 |
| 48-4F | 29.0 - 29.7 |
| 50-57 | 2A.0 - 2A.7 |
| 58-5F | 2B.0 - 2B.7 |
| 60-67 | 2C.0 - 2C.7 |
| 68-6F | 2D.0 - 2D.7 |
| 70-77 | 2E.0 - 2E.7 |
| 78-7F | 2F.0 - 2F.7 |