mirror of
https://github.com/elliotnunn/supermario.git
synced 2024-11-29 20:49:19 +00:00
35 lines
962 B
Plaintext
35 lines
962 B
Plaintext
include 'macintosh.a'
|
|
; desk.a
|
|
;
|
|
; Copyright Apple Computer, Inc. 1984, 1985
|
|
; All rights reserved.
|
|
|
|
|
|
|
|
|
|
|
|
BLANKS ON
|
|
STRING ASIS
|
|
|
|
opendeskacc proc EXPORT
|
|
import c2pstr ; c2pstr(s) char *s;
|
|
import p2cstr ; p2cstr(s) char *s;
|
|
move.l d2,-(sp) ; save register d2
|
|
clr.w -(sp) ; reserve space for result
|
|
move.l 10(sp),a0 ; copy of first parameter
|
|
move.l a0,-(sp) ; push copy of first parameter
|
|
addq.b #1,(a0) ; increment the first byte
|
|
jsr c2pstr ; convert to Pascal string
|
|
move.l d0,a0 ; copy of first parameter
|
|
subq.b #1,1(a0) ; decrement the first byte
|
|
dc.w $A9B6 ; trap to opendeskacc
|
|
move.l 10(sp),-(sp) ; push copy of first paramter
|
|
jsr p2cstr ; convert back to C string
|
|
add.w #4,sp ; balance stack
|
|
move.w (sp)+,d0 ; load result
|
|
ext.l d0 ; extend result to long
|
|
move.l (sp)+,d2 ; restore register d2
|
|
rts
|
|
|
|
END
|