home *** CD-ROM | disk | FTP | other *** search
- ;* -------------------------------------------------- *
- ;* TURBOPTR.ASM *
- ;* Maschinen-Prozeduren zur Unit "TurboPtr.Pas" *
- ;* (c) 1989, 1992 H.Zorba & DMV-Verlag *
- ;* -------------------------------------------------- *
-
- Code Segment
-
- Public IncPtr,DecPtr,GetWPtr,GetBPtr,PutWPtr,PutBPtr
-
- Assume CS:Code
-
- ;* -------------------------------------------------- *
- IncPtr Proc Far
-
- push bp ;üblicher Interface-
- mov bp,sp ;Header
-
- les bx,[bp+8] ;POINTER-Adresse nach
- ;ES:BX (legt nie an
- ;Segment-Grenze )
- mov ax,[bp+6] ;Inkrement in den Akku
- add es:[bx],ax
- jc OvFl1 ;Wenn Segmentwechsel
-
- OutInc: pop bp
- ret 3 ;zurück zu TURBO
-
- OvFl1: mov ax,1000h ;Segmentüberlauf..
- add es:[bx+2],ax ;..behandeln
-
- jmp OutInc
-
- IncPtr endp
-
- ;* -------------------------------------------------- *
- DecPtr Proc Far
-
- push bp
- mov bp,sp
-
- les bx,[bp+8]
- mov ax,[bp+6] ;Dekrement in den Akku
- sub es:[bx],ax
- jc OvFl2
-
- OutDec: pop bp
- ret 3
-
- OvFl2: mov ax,1000h
- sub es:[bx+2],ax
-
- jmp OutDec
-
- DecPtr endp
-
- ;* -------------------------------------------------- *
- GetWPtr Proc Far
-
- push bp
- mov bp,sp
-
- mov dx,ds ;TURBO-Datensegment
- ;merken
- lds bx,[bp+10] ;POINTER-Adresse nach
- ;DS:BX
- mov al,[bx] ;Low-Byte holen
- inc bx
- jz IncSegP ;Wenn Wort auf Segment-
- ;ende liegt
- MoveW1: mov ah,[bx] ;High-Byte holen
-
- lds bx,[bp+6] ;VAR-Adresse nach
- ;DS:BX
- mov [bx],al ;Low-Byte schreiben
- inc bx
- jz IncSegV ;Segmentende erreicht
- MoveW2: mov [bx],ah ;High-Byte schreiben
-
- mov ds,dx
- pop bp
- ret 4
-
- IncSegP: mov cx,ds
- add cx,1000h
- mov ds,cx
- jmp MoveW1
-
- IncSegV: mov cx,ds
- add cx,1000h
- mov ds,cx
- jmp MoveW2
-
- GetWPtr endp
-
- ;* -------------------------------------------------- *
- GetBPtr Proc Far
-
- push bp
- mov bp,sp
-
- les si,[bp+10]
- lodsb
- les di,[bp+6]
- stosb
-
- pop bp
- ret 4
-
- GetBPtr endp
-
- ;* -------------------------------------------------- *
- PutWPtr Proc Far
-
- push bp
- mov bp,sp
-
- les bx,[bp+8]
- mov ax,[bp+6]
- mov es:[bx],al
- inc bx
- jz IncSegP2
-
- MoveW3: mov es:[bx],ah
-
- pop bp
- ret 3
-
- IncSegP2: mov cx,es
- add cx,1000h
- mov es,cx
- jmp MoveW3
-
- PutWPtr endp
-
- ;* -------------------------------------------------- *
- PutBPtr Proc Far
-
- push bp
- mov bp,sp
-
- les di,[bp+8]
- mov ax,[bp+6]
- stosb
-
- pop bp
- ret 3
-
- PutBPtr endp
-
- Code ends
-
- end
- ;* -------------------------------------------------- *
- ;* Ende von TURBOPTR.ASM *
-