UMBC CMSC 391 -- Programming Microcontrollers  


Register Address Mode

Only registers A, DPTR, and R0 to R7 are considered register mode addressing.

2000:                   .org    0x2000
                   
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                   ;; Equates                                  ;;
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                   ;; Code                                      ;;
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                   
                   begin:
                   
                   ;;; Interesting time/memory fact
2000: 90 12 34             mov  DPTR, #1234h  ; 3 bytes, 2 cycles
2003: 75 83 12             mov  DPH, #12h     ; 3 bytes, 2 cycles
2006: 75 82 34             mov  DPL, #34h     ; 3 bytes, 2 cycles
                   
2009: E5 FF                mov  A, -1
200B: F8                   mov  R0, A
200C: F9                   mov  R1, A
                   
                   ;       mov  R1, R0        ; can't do register to
                                              ; register
                   
200D: 7A 10                mov  R2, #16
200F: 7B 10                mov  R3, #10h
2011: 7C 10                mov  R4, #00010000b  ;  All three the same
2013: 22                   ret
                   
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                   ;; Data                                      ;;
                   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


©2004, Gary L. Burt