Maxim-integrated MAXQ7666 Bedienungsanleitung Seite 376

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 386
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 375
MAXQ7665/MAXQ7666 Users Guide
15-7
15.4 ROM Example 1: Calling A MAXQ7665 Utility ROM Function Directly
This example shows the direct addressing method for calling MAXQ7665 utility functions, using the function moveDP1inc to read a
static string from code space. Note the equate UROM_MOVEDP1INC.
UROM_MOVEDP1INC EQU 08877h
Text:
DB “Hello World!”,0 ; Define a string in code space.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Function: PrintText
;; Description: Prints the string stored at the “Text” label.
;; Returns: N/A
;; Destroys: ACC, DP[1], DP[0], and GR.
;; Notes: This function assumes that DP[0] is set to word mode, and
;; DP[1] is in byte mode.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PrintText:
move DP[1], #Text ; Point to the string to display.
move ACC, DP[1] ; “Text” is a word address and we need a
sla ; byte address, so shift left 1 bit.
or #08000h ; Code space is mapped to 8000h when running
move DP[1], ACC ; from the ROM, so the address must be masked.
PrintText_Loop:
call UROM_MOVEDP1INC ; Fetch the byte from code space.
move ACC, GR
jump Z, PrintText_Done ; Reached the null terminator.
call PrintChar ; Call a routine to output the char in ACC
jump PrintText_Loop ; Process the next byte.
PrintText_Done:
ret
Maxim Integrated
Seitenansicht 375
1 2 ... 371 372 373 374 375 376 377 378 379 380 381 ... 385 386

Kommentare zu diesen Handbüchern

Keine Kommentare