This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:traps:trap_1:mptr [2010/11/01 16:18]
george.gwilt created
qdosmsq:traps:trap_1:mptr [2010/11/01 16:20] (current)
george.gwilt Correct code (movea.l to movea.w)
Line 1: Line 1:
 +====== SMS_MPTR ======
 +This trap returns the pointer to a message.
 +^Call Parameters^^Return Parameters^^
 +|A1.L|Message code.|A1.L|Pointer to message.|
 +===== Errors =====
 +No errors are returned by this trap.
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * A message group is a set of messages such as error messages or months of the year. To find the pointer to the Rth message in the Gth group the code in A1.L should be set as the negated value of G*2^7 + R-1.
 +  * A1 can be set to the actual address of a message with the MSB set. In that case the address with the top bit cleared is returned. (Why would anyone want to do that?)
 +===== Example =====
 +The example below shows the use of this trap call to obtain the address of the second message in the third message table.
 +        moveq   #2,d0           ; For the third message table
 +        lsl.l   #7,d0           ; Multiply by 2^7
 +        addq.w  #2,d0           ; For the second message
 +        neg.w   d0              ; Negate it
 +        movea.w d0,a1           ; Set A1
 +        moveq   #$34,d0         ; SMS_MPTR
 +        trap    #1              ; Set pointer to A1.L
  • qdosmsq/traps/trap_1/mptr.txt
  • Last modified: 2010/11/01 16:20
  • by george.gwilt